Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Quickstart Tutorials

Cache Configuration

ASP.NET 2.0 includes new features for configuring the cache.

Cache Profiles

Cache profiles allow cache settings for hundreds of pages to be deployed and managed centrally from configuration. Individual pages can still override the settings in the profile by specifying them in the <%@ OutputCache %> directive, but for manageability purposes they can simply inherit most or all settings from a cache profile. In the example below, the page uses a cache profile specified with a CacheProfile attribute, with the cache settings located in the profile entry in the <outputcachesettings> section of the <caching> configuration section group.

VB Cache Profiles
Run Sample View Source

Cache Properties in Configuration

ASP.NET 2.0 now includes support for configuring the resource allocation for the cache. The caching configuration sections are separated into 3 top-level sections, all contained within the <caching> section group, which it included under <system.web>:

  • cache. Contains application settings pertaining to the cache, including limiting the memory usage and disabling features.
  • outputCache. Contains application settings pertaining to the output cache, including disabling output or fragment caching.
  • outputCacheSettings. Contains cache settings that can be used by individual pages/controls within the app and can be declared at any level.
For more details on the cache configuration see the ASP.Net 2.0 documentation.