I need to get some clarification on how this object is being implemented:
1. Global to the entire application (single server) -- is this on a per user session? Meaning Cache for user session A will be different from Cache for user session B?
2. What could cause the Cache values to be unreliable aka -- not available or cleared out (prior to expiration time)?
Thanks, Rob.
Hi,
Cache is global to entire application. It is one and the same for all users e.g shared for all users. Session is the user-specific data storage on the server.
Cache values can be cleared under memory pressure (priority depends on if one is explicitly given when cache item is added), and when AppDomain restarts: application pool restarts, web.config change, multiple file operations, maximum number of recompiles etc etc
Therefore you should check cache item for null reference before trying to access it. Steve Smith ahs written excellent article about ASP.NET caching (it's old but still valid):http://msdn2.microsoft.com/en-us/library/aa478965.aspx
Thank you for the response.
So if I were to add something like TextBox.ClientID (as the key) to the Cache, it would be possible for another user session to overwrite or get that same Cache item if they used the same TextBox.ClientID?
Rob.
Yes because it it is essentially one and the same storage for all users.
0 comments:
Post a Comment