| ||||||||||||||||||||||||||||||||||||||
<caching> cache ElementASP.NET Syntax ASP.NET Configuration Sections Defines application-wide cache settings for an ASP.NET Web application. configuration Element (General Settings Schema)system.web Element (ASP.NET Settings Schema) caching Element (ASP.NET Settings Schema) cache Element for caching (ASP.NET Settings Schema)
| ||||||||||||||||||||||||||||||||||||||
| Attribute | Description |
|---|---|
|
disableMemoryCollection |
Optional Boolean attribute. Gets or sets a value indicating whether the cache memory collection that occurs when the machine is under memory pressure is disabled. |
|
disableExpiration |
Optional Boolean attribute. Gets or sets a value indicating whether cache expiration is disabled. When disabled, cached items do not expire and background scavenging of expired cache items does not occur. |
|
privateBytesLimit |
Optional Int64 attribute. Gets or sets a value indicating the maximum size of an application's private bytes before the cache starts flushing expired items and attempting to reclaim memory. This limit includes both memory used by the cache as well as normal memory overhead from the running application. A setting of zero indicates that ASP.NET will use its own heuristics for determining when to start reclaiming memory. |
|
percentagePhysicalMemoryUsedLimit |
Optional Int32 attribute. Gets or sets a value indicating the maximum percentage of a machine's physical memory that can be consumed by an application before the cache starts flushing expired items and attempting to reclaim memory This memory usage includes both memory used by the cache as well as the normal memory usage of the running application. A setting of zero indicates that ASP.NET will use its own heuristics for determining when to start reclaiming memory. |
|
privateBytesPollTime |
Optional TimeSpan attribute. Gets or sets a value indicating the time interval between polling for the application's private bytes memory usage. |
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 cache 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 | |
|---|---|
<cache disableMemoryCollection = "false" disableExpiration = "false" privateBytesLimit = "0" percentagePhysicalMemoryUsedLimit = "89" privateBytesPollTime = "00:02:00" /> <cache disableMemoryCollection="false" disableExpiration="false" privateBytesLimit="0" percentagePhysicalMemoryUsedLimit="90" privateBytesPollTime="00:02:00" /> | |
ExampleThe following example sets the global cache settings for an ASP.NET application.
Copy Code | |
|---|---|
<cache disableMemoryCollection = "false" disableExpiration = "false" privateBytesLimit = "20971520" percentagePhysicalMemoryUsedLimit = 60" privateBytesPollTime = "00:01:00"/> | |
Default Configuration
The following default cache 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 | |
|---|---|
<cache disableMemoryCollection = "false" disableExpiration = "false" privateBytesLimit = "0" percentagePhysicalMemoryUsedLimit = "89" privateBytesPollTime = "00:02:00" /> <cache disableMemoryCollection="false" disableExpiration="false" privateBytesLimit="0" percentagePhysicalMemoryUsedLimit="90" privateBytesPollTime="00:02:00" /> | |
ExampleThe following example sets the global cache settings for an ASP.NET application.
Copy Code | |
|---|---|
<cache disableMemoryCollection = "false" disableExpiration = "false" privateBytesLimit = "20971520" percentagePhysicalMemoryUsedLimit = 60" privateBytesPollTime = "00:01:00"/> | |