This article provides manual and programmatic methods of clearing the SharePoint designer cache for both SharePoint 2010 and 2013. Clearing the cache will remove any past connection history as well provide you a “clean slate” to work from. Note that the cache is not cleared even after doing a reinstall, so this really is the only way to clear it.
Some of the symptoms you may notice that indicate a need to clear the cache include:
- Error message: “Cannot perform this operation. The file is no longer checked out or has been deleted.”
- Missing code conditions inside SharePoint designer workflows
SharePoint also has some other caches that may often need to be cleared depending on what you’re working with. Like this one. Here, we’ll be focusing on SPD cache only.
Clearing the SharePoint Designer Cache Manaually
You essentially need to delete the contents of two windows folders…
- Close SharePoint designer if it is open
- Using Windows explorer, go to: %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache
- Delete everythig inside that folder
- Now go to: %APPDATA%\Microsoft\Web Server Extensions\Cache
- Delete the contents of that folder as well
Your SharePoint designer cache is now cleared.
Completely Disable the SharePoint Designer Cache
If you find yourself needing to clear the cache too often, you may want to completely prevent SharePoint designer caching in the first place. To do that, open SharePoint designer and…
- Navigate to the “File” menu. Then go to Options >> General >> Application Options
- On the “General” tab, under the “General” heading, deselect “Cache site data across SharePoint Designer sessions”
- Press OK to save the changes
Going forward, SharePoint designer will not automatically cache any content.
Using PowerShell to Clear the Cache
For those who prefer using quick PowerShell commands or a PowerShell script, here’s the code you need:
Remove-Item "$($env:APPDATA)\Microsoft\Web Server Extensions\Cache\*" -recurse -force Remove-Item "$($env:USERPROFILE)\AppData\Local\Microsoft\WebsiteCache\*" -recurse -force
You could just run those commands individually in PowerShell. But you may want to save the commands as a .ps1 script for future reference. When you run into a caching issue, make sure you close SharePoint Designer first. Then simply right click the .ps1 script file and run with PowerShell.
This slightly fancier version does the same thing but first checks if SharePoint designer is open, etc.
if(Get-Process 'SPDESIGN' -ea SilentlyContinue) { "Please close SharePoint Designer before running this script!" } else { if (Test-Path $Env:USERPROFILE"\AppData\Roaming\Microsoft\Web Server Extensions\Cache") { Remove-Item $Env:USERPROFILE"\AppData\Roaming\Microsoft\Web Server Extensions\Cache" -force -recurse -ErrorAction SilentlyContinue } if( test-path $Env:USERPROFILE"\AppData\Local\Microsoft\WebsiteCache") { Remove-Item $Env:USERPROFILE"\AppData\Local\Microsoft\WebsiteCache" -force -recurse -ErrorAction SilentlyContinue } Write-host "SharePoint Designer Cache Cleared!" }
Leave a Reply