XML-Based Client Configuration (Windows Server AppFabric Caching)
You can use an XML file to configure the client caching features of Windows Server AppFabric. An XML-based configuration for the cache client is an excellent choice when configuration details can change after compiling the application. By having an application configuration file, changes such as setting cache host connection details or trace levels are quick and easy.
Using an XML application configuration file is not the only choice you have for configuring the cache client. You can also configure the cache client programmatically by providing configuration settings to the DataCacheFactory class constructor. For more information, see Programmatic Client Configuration (Windows Server AppFabric Caching).
|If any settings are specified in the application configuration file when configuring the cache client programmatically, the programmatic settings always take precedence.|
The following XML elements are used to configure the cache client in the application configuration file.
<configSections>: For AppFabric caching features to work, this element must be the first element in the application configuration file. It contains child elements that tell the runtime how to use the
<dataCacheClient>: This element is the primary element used to configure the cache client. It is the parent to the elements used to enable local cache (
localCache) and specify the cache hosts (
<localCache>: This optional element specifies the local cache settings, and is a child of the
dataCacheClientelement. Local cache is disabled if the
<localCache>element is not present or if the
isEnabledattribute is set to "false". The
syncattribute allows you to specify how locally cached objects will be invalidated:
ttlValueattribute specifies the default length of time that objects stay in the cache before they expire. For more information about invalidation, see Expiration and Eviction (Windows Server AppFabric Caching).
<clientNotification>: This optional element allows you to specify a custom poll interval value. The
pollIntervalis used to specify how many seconds it should wait before checking for new cache notifications. For more information about cache notifications, see Cache Notifications (Windows Server AppFabric Caching).
<hosts>: This element is a parent to the host elements that specify the cache hosts. It is a child of the
<host>: This element specifies one cache host. Ideally, use
hostto specify a lead host. This element is a child of the
<securityProperties>: This optional element specifies the security mode and protection level that should be used to communicate with the cache cluster.
<transportProperties>: This optional element specifies the transport properties for the communication with the cache cluster.
For more information about the application configuration file settings, see Application Configuration Settings (Windows Server AppFabric Caching).
In This Section
ConceptsProgrammatic Client Configuration (Windows Server AppFabric Caching)
Configuration Settings (Windows Server AppFabric Caching)
Troubleshooting Windows Server AppFabric Caching
Using Windows PowerShell to Manage Windows Server AppFabric Caching Features
Developing a Cache Client (Windows Server AppFabric Caching)
Windows Server AppFabric Caching Concepts