שתף באמצעות


XML-Based Client Configuration

You can use an XML file to configure the client caching features of Microsoft AppFabric 1.1 for Windows Server. 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.

Note

If any settings are specified in the application configuration file when configuring the cache client programmatically, the programmatic settings always take precedence.

Configuration Elements

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 element.

  • <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 (hosts).

  • <localCache>: This optional element specifies the local cache settings, and is a child of the dataCacheClient element. Local cache is disabled if the <localCache> element is not present or if the isEnabled attribute is set to "false". The sync attribute allows you to specify how locally cached objects will be invalidated: TimeoutBased or NotificationBased. The ttlValue attribute specifies the default length of time that objects stay in the cache before they expire. For more information about invalidation, see Expiration and Eviction (AppFabric 1.1 Caching).

  • <clientNotification>: This optional element allows you to specify a custom poll interval value. The pollInterval is used to specify how many seconds it should wait before checking for new cache notifications. For more information about cache notifications, see Cache Notifications (AppFabric 1.1 Caching).

  • <hosts>: This element is a parent to the host elements that specify the cache hosts. It is a child of the dataCacheClient element.

  • <host>: This element specifies one cache host. Ideally, use host to specify a lead host. This element is a child of the hosts element.

  • <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 (AppFabric 1.1 Caching).

In This Section

See Also

Concepts

Programmatic Client Configuration
Configuration Settings
Troubleshooting AppFabric Caching
Using Windows PowerShell to Manage AppFabric 1.1 Caching Features
Developing a Cache Client
AppFabric Caching Concepts (AppFabric 1.1 Caching)

  2012-09-12