You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently expired items aren't evicted from the cache. So if you store a bunch of items that expire and never get refreshed, all of those cached items will remain in memory.
When we read from cache and the item is expired, we should remove it from the cache before returning nil to ensure that it gets cleaned up.
#20 will fix the issue of removing expired items from cache, but this will only happen when an item is read.
We still have the issue of items expiring but then never being read again for us to know to remove them. We would still need some sort of cache sweeper that finds items expired and removes them. Maybe like if they've been expired for longer than X then there's a high chance they are LRU cache items so we can just remove them completely.
Now the big question is, does this shard create some sort of loop that runs in a spawn? Or does it just create a worker class and leave it to you to run in your own cron? 🤷♂️
Activity
Ensure expired items are removed from the cache when they're read. Fixes
jwoertink commentedon Mar 12, 2026
#20 will fix the issue of removing expired items from cache, but this will only happen when an item is read.
We still have the issue of items expiring but then never being read again for us to know to remove them. We would still need some sort of cache sweeper that finds items expired and removes them. Maybe like if they've been expired for longer than X then there's a high chance they are LRU cache items so we can just remove them completely.
Now the big question is, does this shard create some sort of
loopthat runs in aspawn? Or does it just create a worker class and leave it to you to run in your own cron? 🤷♂️Ensure expired items are removed from the cache when they're read. Fixes