Add ability to detect when `MemoryCacheStore` reaches max size
What is the problem this feature will solve?
Currently it's possible to configure a maxSize with MemoryCacheStore, but there doesn't seem to be any way to detect when this max size has been exceeded.
new Undici.cacheStores.MemoryCacheStore({
maxSize: 100_000_000,
})
What is the feature you are proposing to solve the problem?
Add a mechanism to detect when the max size has been exceeded.
What alternatives have you considered?
No response
An event (e.g. full) or a property (e.g. size getter) can be helpful here; but of curiosity, what use case are you looking exactly?
I simply want to know when the cache is full, so I can consider either increasing the max size or optimizing cache usage.
Got it, would you like to send a PR for that?
I'd like to work on this. I'm thinking of adding a size getter, and an isFull method. Thoughts?
Would it make sense to have an event for when the max size is reached?
Yes, I believe this makes sense. Perhaps all three would be useful.