Chapter 23. The System.Web.Caching Namespace
The System.Web.Caching namespace includes types used
for ASP.NET caching. The Cache
class is the focal point of this namespace; it contains a collection of
cached objects and allows you to set expiration policies and
dependencies for each item in the cache. The CacheDependency class
encapsulates a cache dependency and allows you to link the validity of
a cache item to another item or a file on the web server. The CacheItemRemovedCallback delegate
allows you to respond when an object is dropped from the cache. Both types work in conjunction with the Cache class. Together, they allow
you to implement sophisticated data caching.
ASP.NET also supports page caching, which stores entire compiled pages
for automatic reuse. To configure settings for page caching, you must
use the System.Web.HttpCachePolicy class.
Figure 23-1 shows the
types in this namespace.

Figure 23-1. The System.Web.Caching namespace
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access