MichaCo / CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
http://cachemanager.michaco.net
Apache License 2.0
2.35k stars 456 forks source link

[Question] synchronize cache layer on application startup #370

Closed macchmie3 closed 1 year ago

macchmie3 commented 1 year ago

Hi, I was wondering if there is any method that I could call during startup of my app to synchronize cache layers. What I mean - there might be some data sitting on Redis server that I would like to pull to the in-memory layer, so that the 1st calls to my API after startup do not have to wait for response from Redis server.

MichaCo commented 1 year ago

No there is nothing like that build in and that might be a bad idea as a general feature as it is pretty specific.

If you know the cache keys you could just iterate and get all of them. But if you don't know the keys, it will be harder to implement and you cannot do that just with CacheManager alone as I do not allow iterating keys.