Reputation: 219
Just want to double check something. I have the following code:
if (HttpContext.Current.Cache["DataTable"] == null)
{
Cache.Insert("DataTable", DtMaster, null, DateTime.Now.AddMinutes(2),
System.Web.Caching.Cache.NoSlidingExpiration);
}
Say user A logs in and creates a datatable containing 3 rows, if user B then logged on to a completely machine would they also see 3 rows?
I guess I'm asking does items stored in the cache become available to all users?
Thanks.
Upvotes: 0
Views: 477
Reputation: 165
Yes. It will work for multi user's, Please don't forget to Reset the cache in case of any change is happening in db which is related to this datatable records.
Upvotes: 0
Reputation: 583
Yes.
There is one instance of the Cache class per application domain. As a result, the Cache object that is returned by the Cache property is the Cache object for all requests in the application domain.
Upvotes: 1