Open PatryxCShark opened 2 years ago
I found the problem. It seems that the problem is different than I described above and connected with:
.AddExpirationToken(new CancellationChangeToken(_myCacheCancellationTokenSource.Token))
_myCacheCancellationTokenSource is added as singleton and read from constructor (DI).
When I call _myCacheCancellationTokenSource.Cancel()
all entries should dissapear from cache and it works as expected.
But when they are load again into cache, they are not saved in cache because _myCacheCancellationTokenSource has cancel state. I want to have "refreshed" (not canceled) token for new entries.
Any idea how I can achieve scenario:
Describe the bug Absolute expiration seems to not work. In unit tests (C#, Windows) it's ok but after deploying on Linux server, each time function to load data is called.
To Reproduce
Let's say class: MyCachingManager:
And example of using:
Any idea why every time addItemFactory is called (LoadMyData)? When I used MemoryCache there was no problem and it worked as expected (expiry every 3 minutes).
Expected behavior Entry in Lazy Cache should expiry 3 minutes after last loading data into cache.
Framework and Platform