Caching is the ability to store page output and data in memory for the first time it is requested and later we can quickly retrieve them for multiple, repetitious client requests. It is like keeping a copy of something for later use, so we can reduce the load factor on Web servers and database servers by implementing caching on a Web application.
Cache.Add("dataset", dataset, Nothing, System.Web.Caching.Cache.NoAbsoluteExpiration, New TimeSpan(0, 0, 60), System.Web.Caching.CacheItemPriority.[Default],Nothing)
Cache.Add("dataset", dataset, null, System.Web.Caching.Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 60), System.Web.Caching.CacheItemPriority.Default, null);
Retrieve data from cachevb.net
Dim ds as New DataSet
ds = CType(Cache("dataset"),DataSet)
DataSet ds = new DataSet();
ds = (DataSet) Cache["dataset"];
It becomes more efficient to serve a copy of the initial response, rather than regenerating the same response for every client request.
ASP.NET provides two types of caching, Application Cache and Page Output Cache. The application cache, which provides a programmatic way for you to store arbitrary data in memory using key/value pairs. The Page output caching, which saves the output of page processing and reuses the output instead of re-processing the page when a user requests the page again.