Edit Cache Configuration Settings with Windows PowerShell
Collapse the table of content
Expand the table of content

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

  1. Use the Get-CacheConfig or Export-CacheClusterConfig commands to view the current cluster configuration settings.

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

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

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

  1. Use the Get-CacheConfig or Export-CacheClusterConfig commands to view the current cluster configuration settings.

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

  3. Stop the cache cluster if it is running with the Stop-CacheCluster. Note: This will flush all data out of the cache cluster.

  4. Use the Set-CacheCluster command with the CacheName parameter to make the desired cache host or named cache configuration changes.

  5. Start the cache cluster with the Start-CacheCluster command for the new configuration settings to take effect.

See Also

Community Additions

ADD
Show:
© 2016 Microsoft