SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer
Thanks for links and the great summary. – LeviS Oct 24 '11 at 17:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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