This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm considering using the default cache (system.web.caching.cache). Does the default cache support sliding expiration? i.e. if I set "Cache Expiry" to 15 minutes, and the entity is accessed every 5 minutes, would it be reloaded from the DB every 15 minutes regardless, or, does the expiration "slide" and the expiration timer restarts every time the entity is accessed, thereby never needing to reload it back from the DB? Thanks for the clarification! ~Bill |
|
|
This depends on the underlying cache implementation. For the default (ASP.NET) cache, we pass an expiry timeout rather than an absolute expiration time, which results in sliding expiration i.e. accessing an item restarts the expiry timer. For the memcached cache, it looks like memcached requires an absolute expiry time, and we update this whenever we add or update a cached item. So I believe this be sliding for updates but not for accesses -- that is, if you save a changed item, that resets the expiry, but if you access an item, it does not reset the expiry. You can of course create your own ICache implementations to implement your own expiry policies -- we just pass the expiry setting on to the ICache implementation so you could easily write an implementation that used the ASP.NET cache but with absolute instead of sliding expiry. |
|