Article ID: 2289730 - Last Review: August 17, 2010 - Revision: 4.0

Manual manipulation of the SharePoint disk based BLOB cache folder hierarchy is unsupported

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
Expand all | Collapse all

SUMMARY

The SharePoint disk based cache for BLOBs (Binary Large OBjects) maintains a folder and file hierarchy on a local drive of the Web Front End servers. This hierarchy is mirrored in an in-memory index, that is persisted to disk each time the SharePoint Application Domain is shut down. Modifying or deleting files or folders from the disk based cache will result in a loss of synchronization between the disk cache and the information stored in the in-memory cache index. This mismatch will eliminate the performance benefits typically gained by using the BLOB cache, for the mismatched files. This will aslo place greater load upon the database server potentially impacting all database server operations. Therefore, any manual manipulation of the files or folders related to the BLOB cache is unsupported.

MORE INFORMATION

If you have manually manipulated the cache hierarchy and wish to return to a supported state, you must flush the cache to reset the index and remove all the files in the hierarchy. Depending on the size of your cache structure, the performance of the disks on your Web front end servers and the ability of your database server to tolerate the added load of repopulating the cache, this action may have a detrimental effect. It is highly reccomended that you perform this reset at the start of a low activity period in your workload cycle to facilitate a more gradual repopulation of the cache.


Microsoft Office SharePoint Server 2007
Resetting the cache in Microsoft Office SharePoint Server 2007 can most easily be accomplished using the Site Actions administrative user interface. To flush the cache using the administrative user interface, you perform the following steps:
  1. On the Site Actions menu, point to Site Settings, and then click Modify All Site Settings.
  2. Under Site Collection Administration, click Site collection object cache.
  3. In the Disk Based Cache Reset section, do one or more of the following:
    • To force the server to reset its disk-based cache, select Force this server to reset its disk based cache.
    • To force all servers to reset their disk-based caches, select Force all servers in the farm to reset their disk based cache.
    Collapse this tableExpand this table
    Collapse this imageExpand this image
    Note
    Note
    If you select one or more of the check boxes, all entries in the disk caches are flushed immediately when you click OK. If you do not select any of the check boxes, the disk caches are left unchanged and item expiration is managed, with items being removed when they are changed in the site or when the disk size is exceeded.
  4. Click OK.
Microsoft SharePoint Server 2010
Resetting the cache in Microsoft SharePoint Server 2010 is only accomplished using the SharePoint Object Model. Access to the SharePoint Object Model in SharePoint Server 2010 is facilitated by the use of the SharePoint 2010 Management Shell. A sample script has been provided below that will reset the BLOB cache for an entire site collection on all WFEs in a farm:

# A script to reset the SharePoint 2010 Disk Based Cache for BLOBs

# Example: .\Reset-Blob-Cache.ps1 http://MySiteCollection (http://mysitecollection/)

# Loads the SharePoint 2010 PowerShell extensions so we can easily



# get a reference to our dlls.

try

{

    if(((Get-PSSnapin | foreach {$_.Name}) -contains "Microsoft.SharePoint.PowerShell") -eq $false)

    {

      Add-PSSnapIn Microsoft.SharePoint.PowerShell -ErrorAction Stop

    }

}

catch

{

    Write-Host-ForegroundColor "red" "This script only works on machines with SharePoint 2010 installed.`n"

    Exit

}



# Use Reflection to get a reference to our dlls.

try

{

    $spAssembly = [System.Reflection.Assembly]::GetAssembly([Microsoft.SharePoint.SPSite])

    [System.Reflection.Assembly]::Load($spAssembly) | Out-Null

}

catch

{

    Write-Host-ForegroundColor "red" "Could not locate the SharePoint Assemblies.`n"

    Exit

}



# You must provide a site upon which to execute the cache reset.

if ($args.length -ne 1)

{

    Write-Host "Expected 1 arguments:"

    Write-Host "<site_url>"

    exit

}



$site_url = $args[0]



try

{

    $site = Get-SPSite -Identity $site_url -ErrorAction Stop

}

catch

{

    Write-Host-ForeGround 'Red' "$_"

    Write-Host-ForeGround 'Red' "Please correct the arguments and try again.`n`n"

    Exit

}



$warning = "This will clear the blob cache for all sites in this application, on all WFEs in the farm. `nPress 'y' to continue:"



Write-Host-ForeGround 'Yellow' -noNewLine $warning



$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp")



if ($key.Character -ine "y")

{

    Write-Host "`nYou chose not to flush the cache."

    exit

}



Write-Host "`nFlushing..."

[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($site.WebApplication)



Write-Host "Flushed Cache for:" $site.WebApplication.Name


Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use (http://go.microsoft.com/fwlink/?LinkId=151500) for other considerations.

APPLIES TO
  • Microsoft Office SharePoint Server 2007
  • Microsoft SharePoint Server 2010
Keywords: 
KB2289730