Monday, April 2, 2012

Flush the BLOB cache (SharePoint Server 2010)

BLOB cache is a disk-based cache that stores binary large objects (BLOBs) such as frequently used image, audio, and video files, and other files that are used to display Web pages. Each front-end Web server maintains its own BLOB cache. When you enable a BLOB cache, you specify the file types to include in the cache and also the location of the BLOB cache. The first time that a BLOB file is requested, the file is copied from the database to the BLOB cache on the front-end Web server. Future requests to the front-end Web server for that same file are then served from the file that is stored in the BLOB cache, instead of being served from the database. This reduces the network traffic and the load on the database server

Flush the BLOB cache

When you flush the BLOB cache, you clear the contents of the BLOB cache for a Web application. This is useful if the BLOB cache becomes out of sync with the content. For example, after you restore a content database, the BLOB cache will be out of sync with the content. To correct that situation, you must flush the BLOB cache. The following procedure describes how to flush the BLOB cache for a Web application.

Flushing the BLOB cache for a Web application affects all site collections in the Web application.
You cannot use the user interface to flush the BLOB cache. Instead, you use Windows PowerShell and the SharePoint object model to complete this task.

To flush the BLOB cache
  1. Verify that you meet the following minimum requirements: See Add-SPShellAdmin.

  1. Copy the following code and paste it into a text editor, such as Notepad.

$webApp = Get-SPWebApplication "<WebApplicationURL>"
Write-Host "Flushed the BLOB cache for:" $webApp

  1. Replace <WebApplicationURL> with the URL of the Web application whose BLOB cache you want to clear.

  1. Save the file, and name it FlushBLOBCache.ps1.

  1. On the Start menu, click All Programs.
  2. Click Microsoft SharePoint 2010 Products.
  3. Click SharePoint 2010 Management Shell.
  4. Change to the directory where you saved the file.
  5. At the Windows PowerShell command prompt, type the following command.



No comments:

Post a Comment