Why do I need to call twice the Set on my size limited MemoryCache when I hit the size limit?
问题 We are about to use the built-in in-memory cache solution of ASP.NET Core to cache aside external system responses. (We may shift from in-memory to IDistributedCache later.) We want to use the Mircosoft.Extensions.Caching.Memory's IMemoryCache as the MSDN suggests. We need to limit the size of the cache because by default it is unbounded. So, I have created the following POC application to play with it a bit before integrating it into our project. My custom MemoryCache in order to specify