Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Flush the BLOB cache in SharePoint Server 2013

Published: April 9, 2013

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

Applies to:  SharePoint Server 2013 

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:

Before you begin

note Note:

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:

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.

Caution Caution:

Flushing the BLOB cache for a web application affects all site collections in the web application.

note Note:

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.

    note Note:

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

    note Note:

    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.

    ./FlushBLOBCache.ps1
    
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.