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
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
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?