It is quite possible that you instruct blob cache framework to include only specific SP document Libraries . ( I have mentioned it as document libraries , as you must be aware it does not work well with custom folders created using designer etc)
Suppose I have few heavy .jpeg and .dhx in a spdocumentLibrary called HeavyContent .
I want to cache all .pdf , .doc ,.docx ,.flv,.f4v ,.swf in my web application , but .jpeg and .dhx are the one only from spdoc lib "HeavyContent"
Search for a tag similar to below mentioned in web.config and edit the path parameter. :
This will mark items as specified by path parameter regex for 24 hrs , to be cached.
\.(doc|docx|pdf|swf|flv|f4v)$ <----> everything which ends with extension mentioned
| <----> or
HeavyContent.*\.(dhx|jpeg)$ <----> content inside HeavyContent ending with dhx or jpeg
Disclaimer : I am not sure how performance will be affected by making path parameter complex.
Now suppose your IIS does not support some mime types like dhx and f4v. You have two options :
Option 1 : add mime type at server level in IIS.
Option 2 : use browserFileHandling = "Nosniff" in the webconfig section discussed above. [ Ref : http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx ]
$webAppall = Get-SPWebApplication
foreach ($_.URL in $webAppall) {
$webApp = Get-SPWebApplication $_.URL
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
Write-Host “Flushed the BLOB cache for:” $_.URL
}
Suppose I have few heavy .jpeg and .dhx in a spdocumentLibrary called HeavyContent .
I want to cache all .pdf , .doc ,.docx ,.flv,.f4v ,.swf in my web application , but .jpeg and .dhx are the one only from spdoc lib "HeavyContent"
Search for a tag similar to below mentioned in web.config and edit the path parameter. :
<BlobCache location="C:\myBlob\Public" path="(\.(doc|docx|pdf|swf|flv|f4v)$|HeavyContent.*\.(dhx|jpeg)$)" maxSize="10" max-age="86400" enabled="true" />
This will mark items as specified by path parameter regex for 24 hrs , to be cached.
\.(doc|docx|pdf|swf|flv|f4v)$ <----> everything which ends with extension mentioned
| <----> or
HeavyContent.*\.(dhx|jpeg)$ <----> content inside HeavyContent ending with dhx or jpeg
Disclaimer : I am not sure how performance will be affected by making path parameter complex.
Mime Types with BlobCache
Now suppose your IIS does not support some mime types like dhx and f4v. You have two options :
Option 1 : add mime type at server level in IIS.
Option 2 : use browserFileHandling = "Nosniff" in the webconfig section discussed above. [ Ref : http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx ]
How to Flushing the BLOB cache
- IISRESET [Recommended : Increase the startup and shutdown time limits on the web application to accommodate the extra time it takes to initialize or serialize the cache index for very large BLOB caches]
- Powershell :
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:” $_.URL
}
3. change enable to false in web.config , change location parameter , set enable to true
You may also like: