I am using the ICacheManager of Microsoft.Practices.EnterpriseLibrary.Caching for managing the cache. We add the application reference data against the key.
But the application also have some screens to update this master data and that time this data in cache must be refreshed.
I want to know what is the best way to remove the data against the key from the cache. We also need to make sure that while we are removing the data someone other method must not read the data.
Thanks for your help.
To remove data call the
method. Or if you want to perform an update call the Add method -- this will replace any item in the cache with a matching key (or add the new item if it is not found in the cache).
Internally, when any of Add, Remove or GetData methods are called the cache is locked and then the cache item specified by the given key is exclusively locked. So a specific cache item can only be accessed (updated, removed, or read) by one thread at a time.
In most scenarios this is adequate but you need to expand on "removing the data". Is this just a method call to the cache? Or is there more of a logical process that is occurring?
The Caching Application Block
A Cache Advance for your Applications
Enterprise Library support engineer