Share via

ASP.NET Caching Features

One of the most important factors in building high-performance, scalable Web applications is the ability to store items, whether data objects, pages, or parts of a page, in memory the initial time they are requested. You can store these items on the Web server or other software in the request stream, such as the proxy server or browser. This allows you to avoid recreating information that satisfied a previous request, particularly information that demands significant processor time or other resources. Known as caching, it allows you to use a number of techniques to store page output or application data across HTTP requests and reuse it. Thus, the server does not have to recreate information, saving time and resources.

ASP.NET provides two types of caching that you can use to create high-performance Web applications. The first is called output caching, which allows you to store dynamic page and user control responses on any HTTP 1.1 cache-capable device in the output stream, from the originating server to the requesting browser. On subsequent requests, the page or user control code is not executed; the cached output is used to satisfy the request. The second type of caching is traditional application data caching, which you can use to programmatically store arbitrary objects, such as data sets, to server memory so that your application can save the time and resources it takes to recreate them.

In This Section

  • Caching ASP.NET Pages
    Describes the required modifications you must make to a page to take advantage of page output caching. This includes details about how you can vary the caching of page output, dependent upon requesting URIs, GET query string or form POST parameters, and custom strings. ASP.NET allows you to manipulate the HttpCachePolicy class programmatically through the Page.Response property, or by using declarative directive syntax.
  • Caching Portions of an ASP.NET Page
    Discusses the techniques you can use to cache regions of your pages using the @ OutputCache directive and user controls. This technique is useful if you do not want to cache entire pages.
  • Caching Application Data
    Outlines the concepts behind using the ASP.NET application cache and provides samples of how to use its classes, methods, and properties.
  • @ OutputCache
    Details the syntax available to you, as a page developer, for modifying page output cache settings in an ASP.NET page or user control.
  • ASP.NET Optimization
    Describes the best practices for developing high-performance ASP.NET Web applications. It includes an overview of tools you can use to test and monitor your application's performance. It also includes a list of performance counters that ship with ASP.NET.
  • Creating ASP.NET Web Applications
    Introduces ASP.NET and its features, including Web Forms and Web Services.
  • System.Web.Caching Namespace
    Documents how to use the classes and enumerations that implement ASP.NET application caching.
  • HttpCachePolicy Class
    Contains methods for setting cache-specific HTTP headers and methods for controlling the ASP.NET output cache.
  • HttpCacheability Enumeration
    Provides enumerated values that are used to set the Cache-Control HTTP header.