asp.net.ph

Skip Navigation LinksHome > ASP.NET Applications > ASP.NET Optimization > ASP.NET Caching Features > Caching ASP.NET Pages

Caching ASP.NET Pages

ASP.NET Web Applications   ASP .NET Caching Features


ASP.NET includes a simple yet powerful way to increase a Web server’s throughput by allowing the entire response content from dynamically generated pages to be cached.

Called output caching, this functionality enables subsequent requests for a given page to be satisfied from the cache so the code that initially generates the page does not have to be run upon subsequent requests.

Output caching is enabled by default, but output from any given response is not cached unless the response is explicitly made cacheable. To be eligible for output caching, a given page response must have a valid expiration or validation policy and public cache visibility, which can be set in either of two ways:

  • at design time, by declaratively using the @ OutputCache directive, or
  • at run time, by programmatically using the HttpCachePolicy class that is exposed via the Response.Cache object.

When output caching is enabled, an output cache entry containing the dynamically generated page response is created on the first request to the page. Subsequent requests are then served from this output cache entry until the cached response duration expires.

Once the duration for the cached page expires, the next request is handled explicitly and causes a dynamically generated response. This response is cached again for the given duration.

More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note