I have found an answer to a similar question (System.Web.Caching.Cache.NoSlidingExpiration in asp.net c#) and followed the links, but I need more specific information I cannot find.
NoSlidingExpiration does not reset when you ‘access’ it. But, does that mean when you read it? Or also when you write it?
For example, if I do
Cache.Insert("mykey", 42, null, DateTime.Now.AddMinutes(20), System.Web.Caching.Cache.NoSlidingExpiration);
and then 10 minutes later, I do:
Cache.Insert("mykey", 42, null, DateTime.Now.AddMinutes(20), System.Web.Caching.Cache.NoSlidingExpiration);
again, will the expiry be adjusted?
Thanks!
According to the MSDN doc on Cache.NoSlidingExpiration
That means when you call
AddorInsert, whatever theabsoluteExpirationvalue you have given in that call will be used to expire that item. So in your example:DateTime.Now.AddMinutes(20)means the item will be reset after 20 minutes.