I stumbled upon this PowerShell script (source) to flush the cache of all SharePoint web applications.

Write-Host -ForegroundColor White " - Enabling SP PowerShell cmdlets..."
If ((Get-PsSnapin |?{$_.Name -eq "Microsoft.SharePoint.PowerShell"})-eq $null)
$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue |           Out-Null
$webAppall = Get-SPWebApplication
foreach ($_.URL in $webAppall) {
$webApp = Get-SPWebApplication $_.URL
Write-Host "Flushed the BLOB cache for:" $webApp
Write-Host -ForegroundColor White " - Enabling SP PowerShell cmdlets..."If ((Get-    PsSnapin |?{$_.Name -eq "Microsoft.SharePoint.PowerShell"})-eq $null){   $PSSnapin = Add-  PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null}
$webAppall = Get-SPWebApplicationforeach ($_.URL in $webAppall) {$webApp = Get-    SPWebApplication      $_.URL[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)Write-Host     "Flushed the BLOB cache for:" $webApp}

What errors or events would require you to flush the cache?

1 Answer 1


I would check out Flush the BLOB cache (SharePoint Server 2010) and Sean McDonough's excellent "Client-Server Interactions and the max-age Attribute with SharePoint BLOB Caching".

At a high level BLOB caching is a disk based mechanism that reduces the number of round trips required to the back end SQL server (potentially meaning content is served up faster).

BLOB caching, as with most types of caching can occasionally suffer from sync and / or corruption issues. As stated in the article, flushing the BLOB cache can be useful if it becomes out of sync with content on your site (e.g. after restoring a database).

Note that although its possible to delete the BLOB cache manually (it sits on disk), you should avoid this as it can (as you might expect) lead to further corruption. Use either PowerShell or the the Object Model.

Hope that helps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.