-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Eviction? #28
Comments
Normally, I'd suggest having this as an option and then have all methods automatically enforce the eviction invariants. But because the API design suggests that a "cache" is no more than the path to a directory, I instead propose adding some The naive implementation would then simply iterate over the content and then take out some of the keys based on the configured metric. But the more apparent problem is that |
Original cacache actually has a mark-and-sweep garbage collector built in that's extensible enough to build this feature into, but no one ever did it, so I figured it wasn't that important? Eviction is a very application-specific feature, imo. |
Not exactly eviction, but you can implement a TTL using metadata:
A slightly nicer variant of this would be if the desired TTL could be added to the metadata at |
Read all index entries, and filter by TTL, then remove index and content.
|
This almost works, but there are two problems related to
|
I'm looking at different caching libraries right now for my project and this one looks really cool! However, I cannot find any information on cache eviction. Do I need to implement it manually on top of cacache? Have others already done it? (Is this even possible?)
What I need is some simple (access) time eviction, but I think most use cases require bounded size and some LRU/LFU algorithm.
The text was updated successfully, but these errors were encountered: