What is Caching in ASP.NET?

Define Caching in ASP.NET.

- Caching technique allows to store/cache page output or application data on the client.

- The cached information is used to serve subsequent requests that avoid the overhead of recreating the same information.

There are several types of caching in ASP.NET:

1. Page Output Caching
2. Page Fragment Caching
3. Data Caching

- This enhances performance when the same information is requested many times by the user.

1. Page Output Caching:
- It is implemented by placing an OutputCache directive at the top of the .aspx page at design time.

Example:
<%@OutputCacheDuration="30" VaryByParam= "empId"%>

- In the above example, 'Duration' parameter specifies for how long the page would be in the cache and the 'VaryByParam' parameter is used to cache different version of the page.

2. Data Caching:
- It is implemented by using the Cache object to store and quick retrieval of application data.

3. Page Fragment Caching:
- It is used to store part of a Web form response in memory by caching a user control.
Advantages of Caching - ASP.NET
ASP.NET - Advantages of Caching - It increases performance of the application by serving user with cached output....
Types of caching in ASP.NET
ASP.NET - Types of caching in ASP.NET - Caching in ASP.NET can be of the following types...
Ways of handling exceptions in ASP.NET
ASP.NET - Ways of handling exceptions in ASP.NET - Exceptions or errors are unusual occurrences that happen within the logic of an application. ..
Post your comment