Flush the BLOB cache in SharePoint Server 2013


Applies to: SharePoint Server 2013

Topic Last Modified: 2016-12-16

Summary: Learn how to clear the contents of the BLOB cache for a web application.

A 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.

For more information about BLOB caches, see Plan for caching and performance in SharePoint Server 2013.

In this article:

Because SharePoint 2013 runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint 2013 supports the accessibility features of supported browsers. For more information, see the following resources:

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 have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running Windows PowerShell cmdlets.

    • You must read about_Execution_Policies.

    • Add memberships that are required beyond the minimums above.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.
  2. 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
  3. Replace <WebApplicationURL> with the URL of the web application whose BLOB cache you want to clear.

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

    You can use a different file name, but you must save the file as an ANSI-encoded text file that has the file name extension .ps1.
  5. On the Start menu, click All Programs.

  6. Click Microsoft SharePoint 2013 Products.

  7. Click SharePoint 2013 Management Shell.

  8. Change to the directory where you saved the file.

  9. At the Windows PowerShell command prompt, type the following command.