Cache Variable vs. Session Variable

I'm anxious to get some feedback with regard to using a cache variable in lieu of a session variable.  

My research tells me that caching is the way to go for maintaining state on datasets. However, I've only seen the cache variable discussed as an alternative to an application variable (as opposed to the session variable). I'm actually exploring the idea using of using a cache variable as an alternative to a session variable for maintaining state on a dataset specific to each user (Each user is able to select the fields they wish to view; the user will then be able to page and sort on their results).
I'm estimating a maximum of 1000 simultaneous users on my application. Generally speaking, from a performance and optimization perspective, would I be better off placing these user-specific datasets in 1000 session variables simultaneously taking up memory space or 1000 cache variables simultaneously taking up memory space (Each cache variable would be named after the user's SessionID)? Or is this idea six one way, half-a-dozen the other?
Kind of a funky idea, I know. I'd love to read your views.
Thanks in advance for your help!
0
cjo30080
3/22/2004 7:29:40 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
719 Views

Similar Articles

[PageSpeed] 33

Still interested in getting some feedback on this issue, so I thought I'd bump it up in the que for further consideration.  Thanks!
0
cjo30080
3/23/2004 1:13:09 PM
Reply:

Similar Artilces:

Passing variables vs session variable
what is the advantage of passing the variable in the url vs storing the variable in a session variable and retrieving it in the second webpage you are accessing?  The variable that you will pass using the QueryString will be visible to the user hence not secured. The value that you put in the Session is not available to the user as it is on the server side and hence more secured. HighOnCodingWanna get high! performance wise does it matter? Just my 2 cents... I remember in college the professors would always harp upon using the Session responsibly. Most of the professors were old...

How to get session variable value into a static variable
Hi, On page preinit i am adding few session variables. Now i want to retrive these session variable values into my static variables. protected void Page_PreInit(object sender, EventArgs e) {Session.Add("T", "Default"); Session.Add("T1", "Red"); Session.Add("T2", "Blue");   }   i have few static variables which shud contain these vaules.  public string TT; public string TT1; public string TextForeColor =sess = "#FFFFFF";   i want to get T value into TT ... T1 into TT1..and so on &n...

variable not a variable
Error:Must declare the variable '@cartDateTime'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Must declare the variable '@cartDateTime'. Dim connStr As SqlConnection            Dim cmdInsert As SqlCommand            Dim strInsert As String      &n...

Variable Variables
Hi, Maybe the solution is very simple, but how do I create variable variables in vb.net? I want to use the value of a variable as a part of the name of another variable. A very simple example below: code: Dim a As String a = "1" Label a.Text = "hi" page: <asp:Label id="Label1" runat="server">Label</asp:Label> In need this to change a range of values by using just one loop. I can´t do that without creating a variable variable name. Hi, check out this little demo application I created for you: ...

variable variables?
Hello! How to make a variable receive an increment in the name? I want to do it for example: I have: Label1->Caption = "1"; Label2->Caption = "2"; Label3->Caption = "3"; Label4->Caption = "4"; And I want to do something like that: for (i=1; i<5; i++) { Label+i->Caption = i; } Any idea? Can I do something like that? Thanks and regards Alexandre Create a vector of pointers to the various objects. In your case below, construct a vector (called Labels) of pointers to TLable long enough to hold pointers to...

Complex Objects Stored in the Cache, as Application Variables, and as Session variables
I don't know why, but I had always thought that if I was dealing with a DataTable stored as a Session variable, that if retrieved it from the Session pool and made changes to it that I had to explicitly stored it back in the Session pool in order for those changes to be "permanent".  I just discovered that this is not true.  And it actually makes sense why I don't.But I'm curious, if instead I was using the Application variable pool or the cache, would it work the same way or would I, in fact, have to explicitly store the altered object back?Robert Robert...

variable of variables
Say I have 2 scenarios and I want to use a different variable depending on which scenario applies without coding this logic. So I could have a database table t_variables which has: Scenario: Variable: --------- -------- 1 v_name 2 v_company In my Powerbuilder code I'd have values in v_name & v_company. What I'd like to be able to do is to select which variable to use from the table and assign that to something, e.g. select variable into v_variable from t_variables where scenario = 1 so at this point v_variable would be 'v_name'...

Response.Redirect with Session Variable vs. Global Variable -- Best Practices?
Hi,I have a simple contact form and when the user presses the submit button an email is sent and  I have a response.redirect to "emailSent.aspx" where it says "Your request has been received....etc.".  I have the submit button in a try/catch block.  What I want to do is a "emailFailed.aspx" where it says "Email problem, etc." but I also want to carry over the ex.message text.  I want to pass the ex.error text to the "emailFailed.aspx" page so on pageLoad I can have a label with something like:labelMessage.Text = "There was a problem with your email.  The error is " +...

How to seperate a variable from the cached variable?
I have a cached List<T> object. I want to do something like: List<group> lGroups = Cache["lGroup"];---however, whenever I do an action against lGroups, it modifies the cache. How do I make it so whenever I modify lGroup is does not modify the cache.The Killer Ninja Coding Monkeys thank those that mark helpful posts as answers.My Site | My Examples | My Blog Hi, create a copy of the list:List<group> lCachedGroups = (List<group>)Cache["lGroup"];List<group> lLocalGroups = new List<group>(lCachedGroups);Then do your modifications o...

shared variable or session variable???
I've asked this question on a couple of different forums and usenet and noone has offered a reply, so I thought I'd try it here... I have 2 different web apps that happen to do almost exactly the same things. One I did many months ago and the other is very recent. In both cases, I had data that needed to be available throughout all the functions of the page. Looking at the code, I noticed that in the older one I used a shared variable (woud be static in c#) to hold the needed data. In the newer app, I simply used a session variable. The data itself is a dataTable. My question is:...

Session variables vs. Session States
What is the difference and in what situations are they used. Thanks, Mattypee A session state (the state of your session) holds your session variables. If your session state expires (due to inactivity) then you lose your session variables...and any other info stored for that session. If you need to store USER specific information within a web app, then session variables are one(of several) ways to do it. MajorCatsMajorCats Is there any code that you could show that would give an example? Thanks, Mattypee example of what? reading and writing session variables? ...

Session Variables Vs Session Class
Hi All, I am rewriting a classic ASP application in .NET using ASP.net and C#. We used Session Variables to handle storing the current user information throughout the original application.  I was wondering what the benefits would be of using a Session Class over Session Variables, and also how I could implement this? Many thanks in advance for any information you can give me. Regards, Aj Check this out. I think Session class always beneficial since you have more control over accessing and setting your session variables and exception handling. Check the link for its sample implem...

Variables VS Session + Multiple Session Timeouts
I've read that "http is stateless" which is one reason people use Session variables instead of code behind variables. I'm having problems with session variables vanishing after about 10mins. I've checked "App Options" under "Application Configuration" under the properties of the Virtual Directory (IIS 5 on Win2000).  It sais "Session Timeout = 59mins"  web.config <authentication mode="Forms"> <forms timeout="60" /> </authentication>  <sessionState timeout="58" />   Im using master pages, and have declared public variable and session variab...

global variable vs local variable
hi all, i have a scenario like function is called more than 1000 times.in that function i declared a varible and assigning a value .i felt like declare a global varible use it in that function and assign value.which is best.please tell me in performance point of view. thanks in advance  Hai Good Morning you have call  the function  more than 1000 times Better use Global variables, so you can call the function, anywhere.. it has good performance.suppose it you want assign different values to the variables , whenever the function has been called for that use local ...

Web resources about - Cache Variable vs. Session Variable - asp.net.getting-started

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

AD/CVD ruling and overseas capacity expansions are variables to the current PV boom, says EnergyTrend ...
China's National Reform and Development Commission has announced that there will be no significant reduction in feed-in tariff (FiT) rates for ...

Resources last updated: 12/18/2015 11:51:12 PM