the ASP.NET page can obtain information from within the
Retrieving information from a resource outside the
application will require more processing steps, and will therefore require more
time and resources on the server than if the information can be obtained from
within the application space.
Now, suppose the information’s which sent to browser’s
have already been prepared then how faster the process of web-page.
The ASP.NET 3.5 Framework supports the following types
- Page Output
Page Output Caching caches
an entire page.
- Partial Page
Partial Page Caching enables
you to get around this problem by enabling you to cache only particular regions
of a page.
You use DataSource Caching
with the different ASP.NET DataSource controls such as the SqlDataSource and
ObjectDataSource controls. When you enable caching with a DataSource control,
the DataSource control caches the data that it represents.
Finally, Data Caching is the
fundamental caching mechanism. Behind the scenes, all the other types of caching
use Data Caching. You can use Data Caching to cache arbitrary objects in memory.
For example, you can use Data Caching to cache a DataSet across multiple pages
in a web application.
The Cache object can also
have an expiration which would allow us to reinstitute data into the memory in
intervals. Using the same example as above, we can make the cache expire every
two hours, and repopulate the data. It would do this every 2 hours throughout
the day, allowing the most up to date data to be fetched. Below is an example of
how something can be put into the cache:
AddItemToCache(Object sender, EventArgs e)
itemRemoved = false;
onRemove = new
if (Cache["Key1"] == null)
1", null, DateTime.Now.AddSeconds(60),TimeSpan.Zero, CacheItemPriority.High,
RemoveItemFromCache(Object sender, EventArgs e)
if(Cache["Key1"] != null)
Its nothing but similar to Session with a bit difference
that is Session objects have scope within a particular session while application
objects having scope within entire application.
Creating an application variable is similar to session
Application(“applictionObj”) = “This is an application
from msdn :