Best Practices for Key Eviction/Cache purging #536
blazejkustra
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! I'm building a persistent global state manager on top of Legend-State with indexedDB.
I'm looking for a clean way to implement key eviction (e.g. TTL or LRU) to avoid the persisted store growing indefinitely.
Is there a recommended pattern or hook in Legend-State to intercept persisted keys for pruning, or should I manually manage metadata (lastAccessed, etc.) and clean entries on load/interval?
Beta Was this translation helpful? Give feedback.
All reactions