SharePoint 2013

How to patch SharePoint Distributed Cache the proper way

SharePoint 2013 runs a service called the SharePoint Distributed Cache. The underlying application is Microsoft App Fabric. You may be running an old version of App Fabric and it needs your attention now!

An unpatched Distributed Cache may be the cause of a lot of your SharePoint farms performance issues.

The problem: A lot of blogs have misleading and wrong information on how to properly patch the SharePoint Distributed Cache. Following them will only cause you more issues down the track. Out of frustration, I have documented the steps on how to patch the SharePoint Distributed Cache the proper “manual” way with manual checks. If you follow these steps, you will have zero down time and hopefully a better performing SharePoint 2013 farm if you were on a very early App Fabric CU.

Which AppFabric / Distributed Cache CU do I install?
My advice is to generally update AppFabric with the latest providing it fixes issues that you are currently facing. Also, ensure that there are no obvious regressions with it by doing some research on the Internet. To determine the latest App Fabric Cumulative Update,


Here are the steps on how to patch the SharePoint Distributed Cache:

1. Take stock of your Distributed Cache servers

Get-SPServiceInstance | ? {($_.service.tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService"} | select Server, Status


2. Ensure that Microsoft .NET Framework 4.5 is installed

Regedit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

Ensure the version contains “”. E.g. 4.5.51209


3. Remove server from the load balancer if applicable.

4. Shutdown the service instance on one machine

Add-pssnapin Microsoft.SharePoint.PowerShell
Stop-SPDistributedCacheServiceInstance –Graceful

(wait for a few minutes after running this cmd)

5. Run this to check what SharePoint thinks the list of Distributed Cache servers are:

Get-SPServiceInstance | ? {($_.service.tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService"} | select Server, Status



6. Patch AppFabric 1.1

Manually run the Cumulative update file. E.g. AppFabric-KB3042099-x64-ENU.exe

It should generate a log file here for troubleshooting purposes if required:

C:\ProgramData\Microsoft\E-Business Servers Updates\Updates\Uninstall<number>\Setup.log


7. Check version number

Running the below command should display the desired version level.

(Get-ItemProperty “C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules\DistributedCacheConfiguration\Microsoft.ApplicationServer.Caching.Configuration.dll” -Name VersionInfo).VersionInfo.ProductVersion


8. Apply the Background Garbage collection fix

Skip this step only if the Background Garbage collection fix has been already configured on all SharePoint Distributed cache servers.

To enable the fix, go to the following folder:

%ProgramFiles%\AppFabric 1.1 for Windows Server\

Open notepad and edit DistributedCacheService.exe.config

Paste in the following between the  </configSections> and    <dataCacheConfig> settings in the file:

<add key=”backgroundGC” value=”true”/>




<add key=”backgroundGC” value=”true”/>




Don’t try it any other way as you will have issues starting the Distributed Cache service.


9. Post-patch operations

1. Some additional checks:

  • The Distributed Cache service was stopped earlier

No need to restart AppFabric Caching Service in Windows Services as it should be in the disabled state – since we removed this CacheHost from the Cache Cluster.


2. Reset IIS by running: iisreset /noforce

3. Start the service instance


Add-pssnapin Microsoft.SharePoint.PowerShell
  1. Verify if the SharePoint Distributed Cache Service has been started on the server:
Get-SPServiceInstance | ? {($_.service.tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService"} | select Server, Status
  1. Ensure that the Cache host is up and running:


10. Add back the server in the load balancer

11. Restart from 1 on the next machine

12. Don’t forget the rest of your SharePoint farm has AppFabric installed by default (even though not running). AppFabric on those servers need to be updated too without stopping or starting any services.
For this, run steps 6, 7 & 8 above.



  1. Pingback: AppFabric Update to CU7 | pokingalionwithastick

  2. Hi,
    I was able to upgrade the version of AppFabric however, I could not get the DistributedCache service started.

    I did not get any error message while running the commands on separate lines:
    Add-pssnapin Microsoft.SharePoint.PowerShell

    Please help

  3. Be careful of copying the stuff. You might get “smart quotes” in your text instead of regular quotes.

  4. Beware of the wrong quotation marks in (8.). Tried to start the distributed cache with this wrong code and crashed my distributed cache (cacheHost info is null)… 🙁

  5. Hello ,

    Very Nice article . We have 2 Questions

    1) Do we have to Patch App Fabric on all Servers in Farm irrespective of server is in Cache Cluster or not? Like in our case App Servers are not part of Cache Clusters but only Front Ends ?

    2) Like you have described who to Patch App Fabric in Multi Server Farm where in cache will gracefully shut down from server and move to another server in Cluster , but what will happen in case of single server farm ? Do we have to Gracefully shut down in that case too knowing that there is no additional server in Cache cluster ? If yes , what will be impact on Farm ? Do we have any reference for this ?


Write A Comment