Alachisoft NCache 4.1 - Online Documentation

Dispose Cache

 
After you are done using 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 HttpApplication's Dispose() method. This method is called when the instance of your HttpApplication is destroyed.
 
public virtual void Dispose()
{
Cache _cache = NCache.Caches["myCache"];
// Dispose the cache
_cache.Dispose();
}
 
See Also
 
Copyright © 2005-2012 Alachisoft. All rights reserved.