ASP.NET 1.0 introduced the concept of output caching, which
enables developers to capture and store the generated output of pages,
controls, controllers, and HTTP responses in an in-memory cache. On
subsequent web requests, ASP.NET can then serve content faster by retrieving
and using the generated output from the cache instead of having to execute the
page/controller to regenerate the output from scratch. This can
dramatically improve the performance of your application – especially in cases
where your content is based on data within a database (since when the content
is output cached you end up not having to hit the database on subsequent
requests).
ASP.NET’s output caching system is flexible enough to enable
you to cache different versions of content depending on the
querystring/form-post parameters to a page/controller (for example:
Browse.aspx?category=Beverages versus. Browse.aspx?category=Meat). It
also enables you to cache different versions based on the browser type or
user-language preference of the client visiting your application. This allows
you to cache a mobile version of a page separate from a version optimized for a
desktop browser, as well as to vary the cache entries based on whether the user
wants to read a page in English or French. You can configure ASP.NET to
cache a particular output cache entry for a specific period of time (for example:
1 minute – after which the next request will regenerate the content and cache
it again). You can also configure ASP.NET to dynamically invalidate a
cache entry based on an external event (for example: if the database upon which
the cached content depends changes).
One limitation of output caching with ASP.NET V1->V3.5,
though, is that the cache store itself is not extensible – and the cached
content always has to be stored in-memory.