| ||||||||||||||||||||||||||||||||||||
<caching> outputCache ElementASP.NET Syntax ASP.NET Configuration Sections Specifies application-wide output cache settings. configuration Element (General Settings Schema)system.web Element (ASP.NET Settings Schema) caching Element (ASP.NET Settings Schema) outputCache Element for caching (ASP.NET Settings Schema)
| ||||||||||||||||||||||||||||||||||||
| Attribute | Description |
|---|---|
|
enableOutputCache |
Optional Boolean attribute. Enables/disables the page output cache. If disabled, no pages are cached regardless of the programmatic or declarative settings. Default value is true. |
|
enableFragmentCache |
Optional Boolean attribute. Enables/disables the application fragment cache. If disabled, no pages are cached regardless of the @ OutputCache directive or caching profile used. Includes a cache-control header indicating that upstream proxy servers as well as browser clients should not attempt to cache page output. Default value is false. |
|
sendCacheControlHeader |
Optional Boolean attribute. Gets or sets a value indicating whether the cache-control:private header is sent by the output cache module by default. Default value is false. |
|
omitVaryStar |
Optional Boolean attribute. Enables/disables sending an Http "Vary: *" header in the response. With the default setting of false, a "Vary: *" header is sent for output cached pages. Default value is false. |
None.
| Element | Description |
|---|---|
|
configuration |
The required root element in every configuration file used by the common language runtime and .NET Framework applications. |
|
system.web |
Specifies the root element for the ASP.NET configuration settings in a configuration file. Contains configuration elements that configure ASP.NET Web applications and control how the applications behave. |
|
caching |
Configures the cache settings for a Web application. |
Remarks
Default ConfigurationThe following default outputCache element is not explicitly configured in the machine configuration file or in the root Web.config file, but is the default configuration returned by application in the .NET Framework version 2.0.
Copy Code | |
|---|---|
<outputCache enableOutputCache = "true"
enableFragmentCache = "true"
sendCacheControlHeader = "true"
omitVaryStar = "false">
</outputCache> | |
ExampleThe following example disables the output cache for an ASP.NET application.
Copy Code | |
|---|---|
<outputCache enableOutputCache="false" /> | |
Copy Code | |
|---|---|
<outputCache enableOutputCache = "true"
enableFragmentCache = "true"
sendCacheControlHeader = "true"
omitVaryStar = "false">
</outputCache> | |
ExampleThe following example disables the output cache for an ASP.NET application.
Copy Code | |
|---|---|
<outputCache enableOutputCache="false" /> | |