top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are the various types of caching in ASP?

+1 vote
232 views
What are the various types of caching in ASP?
posted Sep 22, 2015 by Sathyasree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Caching is a technique widely used in computing to increase performance by keeping frequently accessed or expensive data in memory. In the context of a web application, caching retains the pages or data across HTTP requests and reuses them without the expense of recreating them. ASP.NET has 3 kinds of caching, strategiesOutput, CachingFragment and CachingData.

CachingOutput Caching: Caches the dynamic output generated by a request. Some times it is useful to cache the output of a website even for a minute, which will result in a better performance. For caching the entire page the page should have OutputCache directive.<%@ OutputCache Duration="60" VaryByParam="state" %>

Fragment Caching: Caches the portion of the page generated by the request. Some times it is not practical to cache the entire page, in such cases we can cache a portion of page<%@ OutputCache Duration="120" VaryByParam="CategoryID;SelectedID"%>

Data Caching: Caches the objects programmatically. For data caching ASP.Net provides a cache object for eg: cache["States"] = dsStates;

answer Sep 22, 2015 by Shivaranjini
...