Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to clear the SharePoint Server configuration cache

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

During the daily operation and maintenance, you may need to clear the expired configuration cache in SharePoint 2010 / 2013 / 2016. For example, sometimes timer jobs tend to get stuck and clear the cache in this case. You can clear the SharePoint configuration cache manually or use the PowerShell script. In the example, version 2016 of SharePoint Server is used, but the same method applies to previous versions of SharePoint.

Clearing the Configuration Cache Manually

1. Stop SharePoint Timer Service.

2. In File Explorer, go to the% SystemDrive%\ ProgramData\ Microsoft\ SharePoint\ Config folder. The program folder is hidden by default, so you may have to unhide it in File Explorer.

There are several GUID folders in the Config folder. We need to find the one with a hyphen in the name.

You will find a lot of files in this folder. Your goal is to delete all files except cache.ini. First of all, back up the cache.ini file. You can copy and paste it into the same folder. Cache-Copy.ini will be your backup file.

5. Now that you have finished backing up the cache.ini files, the next step is to delete all .xml files. The easiest way to find an cache.ini file among thousands of files is to sort the Type column by clicking the column header.

6. Click Ctrl-A to highlight all files in the folder, and then press Ctrl to click cache.ini to deselect the file.

7. Delete all files. This will allow you to have only cache.ini files in this folder. Do not delete the folder. Your goal is to rebuild the cache in the same folder created by the system.

8. Open cache.ini file. You might expect a lot of information in the file, but it has only 5 or 6 digits, such as 356867. Replace this number with 1 so that the only data in the file is the number 1. Now save the file. Changing this number to 1 will reset the cache and will rebuild the cache after the SharePoint timing service is restarted

9. Start the SharePoint timer service in the service console.

10. You will notice that the cache files begin to populate the folder. In my case, it only takes a few seconds, depending on your environment and configuration

Verify that the value in the cache.ini file is no longer 1. 0. It may be a different 5-6 digit than before.

12. Copy this new cache.ini file to the cache.OLD.ini file, and rename the original backup (cache-Copy.ini) to cache.NEW.ini. The SharePoint configuration cache cleaning has now been completed.

Using PowerShell to Clear the Configuration Cache

The procedure is similar to the manual method:

1. Load the SharePoint add-in into PowerShell.

two。 Stop the SharePoint timer service.

3. Delete cache (xml) files.

4. Reset the cache by setting the value in the cache.ini file to 1

5. Start the SharePoint timer service.

# Stop-Service SPTimerV4 $folders = Get-ChildItem C:\ ProgramData\ Microsoft\ SharePoint\ Configforeach ($folder in $folders) {$items = Get-ChildItem $folder.FullName-Recurseforeach ($item in $items) {if ($item.Name.ToLower ()-eq "cache.ini") {$cachefolder = $folder.FullName}} $cacheIn = Get-ChildItem $cachefolder-Recurseforeach ($cachefolderitem in $cacheIn) {if ($cachefolderitem-like "* .xml") {$cachefolderitem.Delete ()} $a = Get-Content $cachefolder\ cache.ini$a = 1Set-Content $a-Path $cachefolder\ cache.iniread-host "press ENTER" start-Service SPTimerV4

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report