To be succinct. Is possible list all register keys from Memory Cache in the .Net Core Web Application?
I didn't find anything in IMemoryCache interface.
Currently there is no such method in the IMemoryCache
interface to return all the cache keys. As per this github issue comments, i do not think that would be added in the future.
Quoting Eilons comment
I think it's doubtful this would be available because part of the idea with caching is that mere moments after you ask it a question, the answer could have changed. That is, suppose you have the answer to which keys are there - a moment later the cache is purged and the list of keys you have is invalid.
If you need the keys, you should maintain the list of keys in your app while you set items to the cache and use that as needed.
Here is another useful github issue
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments