-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Least Recently Used (LRU) Eviction Strategy #57
Comments
Might be worth investigating with or comparing against (when the time comes) this .NET caching solution which uses a LRU strategy: https://github.com/bitfaster/BitFaster.Caching |
That would be fantastic. LRU and bounded size are two requirements for my usage scenario. |
This is something we are looking for in our team. It would be excellent to have this implemented |
Thanks for your feedback - it won't make the next release (coming in the next few days) but it is definitely something I'm looking into! |
(For my own reference) An interesting LFU cache implementation: https://github.com/papers-we-love/papers-we-love/blob/master/caching/a-constant-algorithm-for-implementing-the-lfu-cache-eviction-scheme.pdf Not sure how applicable it is to this given its a LFU not an LRU plus it is a storage mechanism, not an eviction strategy. There still might be some useful pieces of information to extract from it. |
Issue created from #53 (comment)
Currently the only eviction strategy is one of absolute time. If there was a method to define a "size" of cache, it would be worth exploring a "Least Recently Used" system to ensure that the hottest items stay in the cache.
Thoughts:
AutoEvict
/FixedCapacity
) that manages the more advanced eviction strategyConcurrentDictionary
with cache keys as the key and a custom type as the valueChallenges:
RedisRemoteEvictionExtension
(pass the cache layers in directly) but it is pretty cumbersomeNotes:
To handle a distributed LRU would be excessively complex and likely not useful. Would mean that every access to a cache item (including local) would have to then broadcast that access back through the cache system and whatever distributed backends are used.
The text was updated successfully, but these errors were encountered: