oho hello lovely cache that does exactly what i need in a nice simple way: github.com/ReneKroon/ttlcache
@dumpsterqueer ttl caches are neat, and I wrote some more advanced ones too :P https://git.pixie.town/f0x/synapse-media-proxy/src/branch/main/lib/caches.js
@dumpsterqueer they work surprisingly well too!
bottom three graphs show very nicely how the size always stays under max, while the amount of entries varies drastically :)
https://stats.pixie.town/d/rPBvoh6Gk/synapse-media-proxy?orgId=1&refresh=1m&from=now-2d&to=now