Edit Cache Configuration Settings with Windows PowerShell (Windows Server AppFabric Caching)
Windows Server AppFabric enables you to create and configure your named cache with a Windows PowerShell-based cache administration tool. This topic describes how to use Windows PowerShell to directly create and configure named caches.
Cache configuration settings are stored in the cluster configuration storage location. For more information about the available cache settings, see the Cache Settings heading in Cluster Configuration Settings (Windows Server AppFabric Caching).
There are two Windows PowerShell commands that you can use to edit cache configuration settings: New-Cache
(used with Remove-Cache
) and Set-CacheConfig
(with the -CacheName
parameter). The advantage of using Set-CacheConfig
is that you can change specific cache options without specifying the existing options again. For more information about Windows PowerShell commands, see Using Windows PowerShell to Manage Windows Server AppFabric Caching Features.
The New-Cache
approach requires that the named cache be removed, flushing all data out of the cache. The Set-CacheConfig
requires downtime from the entire cache cluster to implement changes. To optimize availability of your cache cluster, we recommend that you use the New-Cache
(used with Remove-Cache
) approach.
In addition to the procedures described in this topic, you can also directly edit cache configuration attributes in XML. For more information, see Edit Cluster Configuration Settings (Windows Server AppFabric Caching).
These procedures assume that you have a running cache cluster.
To use the New-Cache and Remove-Cache commands to edit cache configuration settings
Use the
Get-CacheConfig
orExport-CacheClusterConfig
commands to view the current cluster configuration settings.Determine which settings you would like to change for the named cache. To minimize downtime of the named cache, we suggest preparing the corresponding
New-Cache
command before proceeding.Remove the named cache from the cluster with the
Remove-Cache
command. Note: This will flush all data out of the named cache but will not impact other named caches in the cluster.Use the
New-Cache
command to create a new named cache with the desired configuration settings.
To use the Set-CacheConfig command to edit cache configuration settings
Use the
Get-CacheConfig
orExport-CacheClusterConfig
commands to view the current cluster configuration settings.Determine which settings you would like to change for the named cache. To minimize downtime of the cache cluster, we suggest preparing the corresponding
Set-CacheCluster
command(s) before proceeding.Stop the cache cluster if it is running with the
Stop-CacheCluster
. Note: This will flush all data out of the cache cluster.Use the
Set-CacheCluster
command with theCacheName
parameter to make the desired cache host or named cache configuration changes.Start the cache cluster with the
Start-CacheCluster
command for the new configuration settings to take effect.
See Also
Concepts
Set the Cluster Management Role and Lead Host Designations (Windows Server AppFabric Caching)
Edit Cluster Configuration Settings (Windows Server AppFabric Caching)
Using Windows PowerShell to Manage Windows Server AppFabric Caching Features
Windows Server AppFabric Caching Configuration Options
Windows Server AppFabric Caching Concepts
Configuring the Cache Cluster (Windows Server AppFabric Caching)
Using Configuration Methods (Windows Server AppFabric Caching)