6. Data and Output Caching

Caching is the act of storing something for later retrieval, and in the Web world it is used to improve performance. There are many factors that affect the performance of Web sites, and two of these are the processing of ASP.NET pages and fetching data from databases. Once a Web site has been launched, the pages themselves generally stay fairly static, with only data changing, and even then that doesn’t always change frequently. Fetching data from a database is relatively slow and uses resources (process, memory, etc.), so if that usage can be minimized, performance can be improved. Likewise, if a page doesn’t change, why process it on every request?

Both of these problems can be solved with caching—storing data so ...

Get ASP.NET 2.0 Illustrated 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.