Caching is veryimportant concept for any web application,
which is used to store the data temporarily either on web server. This data can
be stored for a specific time period on the server or client system. It is more
useful when any use access the same set of data continuously.
Engine(Google, Yahoo etc.) for
searching relevant information. Ifyou
open Google page on your system first time then first time Google pages comes
from Google database. Ifyou open again
Google search engine then this Google page comes from Google server cache.
Accessing a database in an
Asp.net applications generally a slow and time consuming process. To improve
the performance of a asp.net page, we can use Caching concept, which is quicker
than retrieving the data from the database on each request.
Different types of caching:
ASP.NET providing three basic
types of caching:
level output caching
Page level output caching:
In this Caching technique page
output and HTTP response stored in a memory cache (RAM) of the computer. You
can create more than one custom Output Cache provider.
System.web.caching.OutputCacheprovider class is used to create
custom output cache provider which can be registered within the web.config file. This caching concept
is more useful for static web page. In thiscaching data can be stored ondifferent-2 location such as client side, server side or proxy side.
There are some techniques to
implement the page output caching is asp.net application.
Output caching Depends on some control values.
Output caching Depends on some query string key value.
page issavedin cache memory for 40seconds.
can use XML file instead ofsql server
database for this cachingapplications.
2. Fragment Caching(partial page caching):
When we want to
implement caching on specific part of a web page then we can use Fragment
caching or partial caching. This type of caching is implemented by using webusercontrol.
allows caching of data as objects for multiple pages in an application. Asthe cached objects areavailable at application level so it is also
called Application level caching. The cached data for objects are available
until the application is restarted. Data caching allows developers to programmatically
maintain data across requests.