Why use shared cache?
There is no more efficient way to increase the scalable performance of applications then the use caching to unload deeper layers.
>> DotNet native caching>> DotNet Caching>> Caching Asp.Net Pages
Introduction
ASP.Net has a powerful caching system that you can use to improve the response time of your application. If an object consumes a lot of server resources during creation, you able to create it once and store it within the process into cache. While an object is cached, re-usage of it is faster then any other access. Due this behaviour Web Servers responses are much faster then to create it each time from scratch.
Caching information and basic usage
ASP.Net provides the Cache object to provide access to the application cache. Its like a dictonary were cached items are available over a simple string key:
Cache["itemKey"] = "an object or a string"
|
The following sample shows how ASP.Net Cache is used:
string cacheItem = string.Empty;
if(Cache["itemKey"] == null)
{
cacheItem = Cache["itemKey"];
}
else
{
// assign data and add it to cache
cacheItem = "load data from db or any other source";
Cache["itemKey"] = cacheItem;
}
|
While the WebServers memory usage becomes high, the ASP.Net runtime automatically purges items from cache. If you try to access and the requested object has been removed from cache then the above example explains how it should be used. For more detailed information consult http://msdn.microsoft.com
One of the better tutorials about caching you find at the following link: http://www.mnot.net/cache_docs/