Flushing the BLOB cache in SharePoint 2010

If you’re developing a SharePoint-based public Internet portal, you’re probably using the BLOB (Binary Large Object) cache. This caching mechanism stores a copy of the binary files (images, documents and such) in the file system of each front-end web server. This can save a lot of database accesses, thus improving the performance of the web site.

As for any caching mechanism, it is possible that the BLOB cache becomes out-of-sync with the content database, storing an old version of a file that has been updated in the content database.

The quickest way to re-sync the BLOB cache is to flush it and let SharePoint repopulate it with the current version of the binary files. Flushing the BLOB cache can only be done through a PowerShell script (since there is no place for it on the SharePoint UI):

$webApp = Get-SPWebApplication "<WebApplicationURL>"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
Write-Host "Flushed the BLOB cache for:" $webApp

In which <WebApplicationURL> is the URL address of the web application for which you want to flush the BLOB cache.

You can find additional information in: http://technet.microsoft.com/en-us/library/gg277249.aspx