Get cache key/value

Topics: Building and extending application blocks, Caching Application Block , Enterprise Library Core, General discussion
Jun 11, 2007 at 8:51 PM
I want to build administrative page within my application that shows statistics about the cache, and enable him to flush the cache for the application, or flush the cache for specific client, or remove cache key for specific client.
So, i have the following questions: is that possible to..
1. get all the cache keys/values within my application(and the count of them)?
2. get cache keys/values for specific client(and the count of them)?
3. clear all the cache for the application?
4. clear all the cache for specific client?
5. clear specific key/value for specific client?

thank you for your help...
Jun 12, 2007 at 3:29 PM
I would look at the API for the CacheManager Class which should answer all your questions.

It is the CacheManager Class that allows you to get a count of items in a cache, flush the cache, check if an item is in the cache, remove an itemfrom a cache, etc. You cannot enumerate through a cache to get all keys and items, however.




David Hayden
Microsoft MVP C#