Configuration Settings for the ASP.NET 4 Caching Output Cache Provider (AppFabric 1.1 Caching)
This topic covers the configuration settings for the Microsoft AppFabric 1.1 for Windows Server output cache provider for ASP.NET. These settings are specified in the providers section of the outputCache element in the web.config file.
Session State Configuration Settings
Attribute | Description |
---|---|
name (required) |
The “friendly” name of the provider used by the outputCache element to reference the provider. |
type (required) |
The .NET Framework type string for the provider. This should be set to |
cacheName (required) |
The name of the AppFabric cache. |
dataCacheClientName (optional) |
The name of the dataCacheClient section to use from the dataCacheClients configuration section. This attribute is only required if multiple dataCacheClient sections are specified in the web.config file. By default, the provider will use the dataCacheClient section named |
applicationName (optional) |
A string value used by the provider when creating cache keys for storing output cache data. The default is an empty string. When this attribute is not set the provider uses the value of HttpRuntime.AppDomainAppId as part of the cache keys it uses internally. Unlike the session state feature, you do not want to share output cache data across different ASP.NET applications (for example, /contoso and /AdventureWorks cannot share output cache data). Instead ensure that different physical instances of the same application all have access to the same output cache data. There are two different ways to accomplish this:
|
retryInterval (optional) |
A timespan for the length of time to wait between retry attempts if an error occurs when communicating with the cache. The string format to use for this value is |
retryCount (optional) |
An integer value that tells the provider the number of retry attempts in the event of a communications failure with the cache. Note that not all operations are able to be retried. The default value is three retry attempts. The provider sleeps for the configured retryInterval time between each retry attempt. |
Example
The following example shows an outputCache element that uses AppFabric Caching.
<caching>
<outputCache defaultProvider="DistributedCache">
<providers>
<add name="DistributedCache"
type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache"
cacheName="default"
dataCacheClientName="default" />
</providers>
</outputCache>
</caching>
See Also
Concepts
Output Cache Provider (AppFabric 1.1 Caching)
2012-09-12