12,056 total views, 3 views today
Clear config cache in SharePoint – the config cache is a magical directory in the SharePoint server, why I said the magical directory is – for the many problems in SharePoint, the solution is clearing the config cache, mostly when the out of the timer job does not behave as expected or does not run as per the timer job scheduler, then if we clear the config cache, the issue will be fixed. By the way, what is the config cache in the SharePoint server?
Config Cache in SharePoint server – Clear config cache in SharePoint
The config cache is system generated directory or folder in SharePoint which consists of thousands of XML files and a cache.ini configuration settings file, these files get updated upon restarting the SharePoint timer service.
The configuration cache exists on each SharePoint server joined to the farm, regardless of the role of the server.
The cache is stored at the below location:
Syntax: %SystemDrive%\ProgramData\Microsoft\SharePoint\Config Example: C:\ProgramData\Microsoft\SharePoint\Config<GUID>\and consists of thousands of XML files and a single cache.ini file.
These XML files are the farm objects from the SharePoint Configuration database (SharePoint_Config) within the Objects table.
How to clear the SharePoint Configuration cache file?
In order to clear the SharePoint Configuration cache we need to follow the below steps:
- Stop the SharePoint Timer Service on all the servers connected to the SharePoint Farm, start with the server running the Central Administration website, generally, it will be hosted in the application server. Follow the below navigation (click on the start button, then type service.msc and so on as below).
Start -> Services.msc -> SharePoint Timer Service
- Go to the this path: %SystemDrive%\ProgramData\Microsoft\SharePoint\Config (Example: C:\ProgramData\Microsoft\SharePoint\Config)
- There are a couple of folders with the GUID in the Config folder. We want the one that has hyphens in the name.
- Take the backup of the GUID folder (which has a hyphen) and keep it somewhere or on the desktop. Here the purpose is to delete all XML files except the cache.ini file.
- Take the backup of the cache.ini file and keep it in the same location or somewhere in your preferred location.
- Now, key CTRL+A key selects all files in the location and deselects the cache .inf file.
- Delete all XML files.
- Open the cache.ini file. It is a 5 or 6-digit number, e.g. 357856. Now replace this number with just number 1 so the only data in the file is the number 1. Now save the file, change this number to 1 resets the cache and it will be rebuilt after the SharePoint Timer Service is restarted.
- Start the SharePoint Timer Service in the Services Console.
- Wait for a few seconds, then we will see that the same GUID location has been filled up with thousands of XML files again.
- Now, open the cache.ini file again, and verify that the data inside it is not 1 but it has been updated with the 5 or 6-digit number as it was before the update.
- Done, and continue the same steps in the WFE server and other servers connected to the farm.
Summary: Clear config cache in SharePoint
Thus, in this article, we have learned what is SharePoint Configuration cache and how to clear the SharePoint config cache.
See Also: Clear config cache in SharePoint
You may look into the below SharePoint troubleshooting articles:
- You may look into the similar error troubleshooting while you are working with PowerShell – [Fixed] Server relative urls must start with SPWeb.ServerRelativeUrl in reading web part properties!
- Cache settings operations in SharePoint Server