OutputCacheProfile Class
Assembly: System.Web (in system.web.dll)
The OutputCacheProfile class provides a way to programmatically access and modify the add element of the outputCacheProfiles section in the caching section of a configuration file.
The OutputCacheProfile object centralizes frequently used configuration settings such as dependencies, cache location, and cache expiration time, eliminating the need to specify them on every page.
The OutputCacheProfile can be applied to a page using the CacheProfile attribute of the @ OutputCache directive.
Note: |
|---|
| The @ OutputCache directive can override all the settings contained by an OutputCacheProfile object except for the Enabled attribute. This is to enable or disable the OutputCacheProfile without having to modify the directives in all the pages that might have overridden it. |
The CacheDependency class monitors the dependencies so that when any cached item changes, the cached item will be automatically removed.
The following code example shows how to use the OutputCacheProfiles collection to access its OutputCacheProfile objects.
Reference
OutputCacheProfile MembersSystem.Web.Configuration Namespace
OutputCacheProfileCollection
CacheDependency
Other Resources
caching Element (ASP.NET Settings Schema)outputCacheProfiles Element for outputCacheSettings for caching (ASP.NET Settings Schema)
@ OutputCache
Caching Application Data
How to: Set a Page's Cacheability Declaratively
How to: Set a Page's Cacheability Programmatically
Note: