jitbit/FastCache

Feature request: PostEvictionCallback

ruslan528 opened this issue · 2 comments

In common scenarios developer want to log eviction from cache. This is an important feature to improve observability of application. I propose to add new optional parameter to constructor - delegate (see Microsoft.Extensions.Caching.Memory.PostEvictionDelegate).

Thanks!

Do you mean one call back for every item, or cache-global?

I think that "cache-global" implementation will be enough. That universal "PostEvictionDelegate" will receive evicted item - so we will have ability to log his key and value.