Caching ASP.NET Applications
This section discusses how caching works in ASP.NET applications. There are primarily three forms of caching. These are page caching, page fragment caching, and data caching.
Page Caching
Page caching is the process of persisting an entire page on the server, proxy server, or the client browser so that the next time it is retrieved, it does not have to be generated by ASP.NET.
Using the @ OutputCache Directive
Page caching is enabled by including the directive in bold (line 2) in the .aspx file shown in Listing 33.1.
Listing 33.1. .aspx File Containing Page Caching Directive
1: <%@ Page language="c#" Debug="true" Codebehind="WebForm1.pas" AutoEventWireup="false" Inherits="WebForm1.TWebForm1" %>
2: <%@ OutputCache ... |
Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.