0

Is it possible not to expire for CacheItemPolicy.AbsoluteExpiration at the specific time?

MSDN there is written:

The period of time that must pass before a cache entry is evicted.

As I understand this sentence means that no less than the specific time... is it possible if I set 12 hours, but the record will expire (let's say) only in 12.5 hours? (I mean it's not documented, it will take not less than 12 hours, but 12.5 hours is also possible or even more, right?)

for example: I set UpdateCallback and AbsoluteExpiration = 60seconds for my CacheItemPoice, in practice it's called once in 80 seconds. (I logged it)

Inside UpdateCallback I set new values for CacheEntryUpdateArguments, I mean new UpdatedCacheItem (the same key and new data) and UpdatedCacheItemPolicy (the same period of time and the same UpdateCallback)

Alex
  • 221
  • 3
  • 14
  • What are your concerns? Unless there is a polling or synchronization primitives behind I'd expect the item will expire (and will have to be re-read) on access to it. So if you access it 20 sec later it will still exists that long in the cache. – Sinatr Aug 01 '16 at 12:57
  • I created a self-cache updater, I need that it automatically update itself every 12 hours, and I want to know: is it possible that cache will not be expired in 12 hours? (for example, sometimes 12, sometimes 12.2, sometimes, 12.7, and 12 again.. and so on...) – Alex Aug 01 '16 at 13:07
  • 1
    So it's a [polling](http://stackoverflow.com/q/12630168/1997232), thus it's not accurate, this 20 sec is ok (see accepted answer). – Sinatr Aug 01 '16 at 13:19

0 Answers0