I have a service in which I'd like to use MemoryCache, however, one of my requirements is that I need to be able to clear said MemoryCache manually, without stopping the service.
Currently we're using the CacheManager from the Enterprise Library (Using Isolated Store, so I think it's in memory, then dumps to file when needed), and we clear the cache manually by deleting the files. Any ideas on how I may do something similar, using the new cache libraries?
Thanks!
It sounds like your current cache using Enterprise Library has a file system dependency. You can do the same thing with MemoryCache by associating a HostFileChangeMonitor with each cache item. When the monitored file(s) change on disk, the cache items will be purged.