System Cache - duration

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.
 
P

Peter Bromberg [C# MVP]

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
 
M

Michael Nemtsev [MVP]

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top