System Cache - duration

  • Thread starter Thread starter Jordan S.
  • Start date Start date
J

Jordan S.

Just wondering if data that is stored in the system Cache
(System.Web.Caching.Cache) can theoretically stay in the Cache until the
application is restarted. I understand that the system can purge the data in
the Cache at any time... but what is likely to happen on a system that is
not very busy and makes few demands on system resources. Can it be
considered as likely that the data stored in the Cache will be there for a
very long time (hours or all day)?

I'm just wondering more for informational purposes as opposed to solving any
particular problem.

Thanks.
 
There are overloads with the Priority enumeration where you can actually
specify that the cache item will not be evicted (unless the app recycles, in
which case Cache, Application and Session all go bye-bye)
Peter
 
Hello Jordan S.,

use CacheItemPriority.NotRemovable as property of cache object

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


J> Just wondering if data that is stored in the system Cache
J> (System.Web.Caching.Cache) can theoretically stay in the Cache until
J> the application is restarted. I understand that the system can purge
J> the data in the Cache at any time... but what is likely to happen on
J> a system that is not very busy and makes few demands on system
J> resources. Can it be considered as likely that the data stored in the
J> Cache will be there for a very long time (hours or all day)?
J>
J> I'm just wondering more for informational purposes as opposed to
J> solving any particular problem.
J>
J> Thanks.
J>
 
Back
Top