alastairtree / LazyCache

An easy to use thread safe in-memory caching service with a simple developer friendly API for c#
https://nuget.org/packages/LazyCache
MIT License
1.72k stars 159 forks source link

Cache doesnt expire #100

Closed manuelpoelzl closed 4 years ago

manuelpoelzl commented 4 years ago

Iam using lazycache without dependency injection in .asp net core 3.0. However, if i add something to the cache - it doesnt expire.

i tried setting the absolute expire to DateOffset.Now.AddMinutes(10) - but it doesnt work

any ideas?

alastairtree commented 4 years ago

Have you tried getting the the item after the cache has expired? MemryCache, the MS library we use under the hood, triggers cache eviction based on calls into lazycache, and not on a timer, and so that might be why it appears not to work, when infact it is. See this SO for more info https://stackoverflow.com/a/42536192

alastairtree commented 4 years ago

Or maybe this is a result of this issue - #84

alastairtree commented 4 years ago

This is fixed in 2.0.5. Sorry for the delay.