-
Notifications
You must be signed in to change notification settings - Fork 138
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
maxCacheSize option #63
Comments
Thanks! |
This would be GREAT! |
@daluf will take care of this |
This has landed in pr #141 |
I think instead of throwing error, it should remove the oldest entry in cache and accommodate the new entry. Having a fixed size for cache is to limit the memory usage, and cache being full isn't really an error scenario. Just started using this library in a project, and saw this flag in the docs. |
We currently regard sophisticated expiry logic like that as to big for that project :( |
@erdii You used "currently" in your answer around a year ago, so I am asking again about #63 (comment) :) |
up. Evicting oldest key is the best option. Or at least allow us to catch such error using event handling so that we can do that ourselves |
I have been looking into a caching solution for a node project of mine and I think this library looks very useful!. One thing I think could be a great addition though is to have a maximum cache size (perhaps either number of entries or memory size) which when exceeded will cause the check routine to evict the oldest entries from the cache to bring it back down to this size.
This of course would be entirely optional and if not set the cache would operate exactly as it does now.
The text was updated successfully, but these errors were encountered: