NCache 4.4 - Online Documentation

Dispose Cache

 
After you are done using the cache, you can dispose it. Include the following namespace in your project:
 
using Alachisoft.NCache.Web.Caching;
 
The code for disposing the cache is as follows:
 
Cache _cache = NCache.Caches["mycache"];
// Dispose the cache
_cache.Dispose();
 
Disposing the cache in ASP.NET Applications
 
If you're developing ASP.NET application, the best place to put Dispose() call is in your HTTP Application's Dispose() method. This method is called when the instance of your HTTP Application is destroyed.
 
public virtual void Dispose()
{
Cache _cache = NCache.Caches["mycache"];
// Dispose the cache
_cache.Dispose();
}
 
 
See Also