Thursday, December 18, 2008

ASP.Net Cache Dependency

Data Caching in ASP.NET is facilitated via the Cache class and the CacheDependency class in the System. Web.Caching namespace. The Cache Dependency class makes dependencies to be particular for the data items positioned in the cache.We can identify the life span for an item in the cache by using the absoluteExpiration limitation in the Insert method. This parameter allows one to specify the exact date time that the equivalent data item will expire.

You can also use the slidingExpiration parameter, specifying the elapsed time before the item will terminate based on the time it was accessed. Once the item expires, it is removed from the cache. Attempts to access it will return a null value unless the item is added to the Cache again.

For More information visit: asp.net web development

No comments: