Share via


Manage the Office Web Apps cache

 

Applies to: Word Web App Preview, PowerPoint Web App Preview, Excel Online

Topic Last Modified: 2011-08-05

Banner stating end of support date for Office 2010 with link to more info

The information that is provided in this article about how to manage the Microsoft Office Web Apps cache is intended for IT pros who maintain Office Web Apps installed on Microsoft SharePoint 2010 Products on a stand-alone server or a server farm. SharePoint 2010 Products in this article refers to Microsoft SharePoint Server 2010 and Microsoft SharePoint Foundation 2010 unless otherwise noted.

Manage the Office Web Apps cache

The Microsoft Word Web App and Microsoft PowerPoint Web App generate a series of images to create a rendition of a document that is viewable in the browser. If Microsoft Silverlight 3 is installed, XAML is used to create the rendition. Creating the rendition can consume large amounts of computer resources. To reduce resource consumption, the Word Web App and PowerPoint Web App store the renditions in a cache, created as part of a SharePoint content database. Renditions in the cache are then used for future requests of a view of the same document. In an environment where most documents change infrequently, but are viewed regularly, maximizing the space dedicated to the cache or the expiration period, can improve performance and reduce resource consumption. In an environment where most documents frequently change, you can optimize performance by reducing the space that is dedicated to the cache, or by reducing the time documents are stored in the cache.

Both the Word Web App and PowerPoint Web App will run in the context of a single SharePoint Web application. Only one cache is created per SharePoint Web application. If multiple site collections that are stored in different content databases have the Office Web Apps Feature activated, they will all use the same cache.

You can configure the cache by using the following settings:

Cache size   Space available in bytes to render documents. By default, when you install Office Web Apps on a stand-alone server or a server farm, the cache available to render documents is 100 GB (1073741824 in bytes).

Expiration period   Number of days that document renditions can remain in the cache before they are purged and rendered again. By default, the cache expiration period is 30 days.

Location   Database location for the cache (a SharePoint content database). You may want to isolate the Office Web Apps cache from other content so that you can exclude it from backups. To do so, you can create a separate content database, set it to contain only one site collection, and then configure the Office Web Apps cache to use that database. 

Timer jobs   Office Web Apps includes two timer jobs associated with the cache. You can view timer job definitions, job status, and edit timer job settings in Central Administration.

Timer job title Description

Office Web Apps Cache Creation

Ensures that every SharePoint Web application, on which the Office Web Apps are activated, has an Office Web Apps cache associated with it. By default, this timer job runs every 5 minutes.

Office Web Apps Expiration

Expires older documents, and ensures that the Office Web Apps cache does not run out of space. By default, this timer job runs nightly.

Procedures in this task:

  • To set the Office Web Apps cache size and expiration period by using Windows PowerShell

  • To move the Office Web Apps cache database location by using Windows PowerShell

Some procedures in this task require using Windows PowerShell or SharePoint 2010 Management Shell to run cmdlets. To run SharePoint 2010 cmdlets in Windows PowerShell, you must add the Microsoft.SharePoint.PowerShell snapin by using the Add-PSSnapin cmdlet, or you can run the SharePoint 2010 cmdlets by using SharePoint 2010 Management Shell. By default, the Microsoft.SharePoint.PowerShell snapin is already registered, and the snapin is added to the SharePoint 2010 Management Shell. To run SharePoint 2010 cmdlets, you must be a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed. To run scripts in Windows PowerShell or SharePoint 2010 Management Shell, you must set the execution policy by using the set-executionpolicy cmdlet, using the unrestricted parameter. For more information about the Add-PSSnapin cmdlet, see Add-PSSnapin. For more information about how to use Windows PowerShell with SharePoint 2010 Products, see SharePoint 2010 Products administration by using Windows PowerShell.

To set the Office Web Apps cache size and expiration period by using Windows PowerShell

  1. Using Notepad, create a text file and then copy and paste the following script into the file.

    This example sets a cache size of 200 in bytes and an expiration period of 30 days.

    $200gbInBytes = 1024 * 1024 * 1024 * 200 
    Get-SPWebApplication | Set-SPOfficeWebAppsCache -ExpirationPeriodInDays 30 -MaxSizeInBytes $200gbInBytes 
    
  2. Specify the following parameters:

    Parameter Value

    –ExpirationPeriodInDays

    Number (in days)

    –MaxSizeInBytes

    Number (in bytes)

  3. Save the file with a .ps1 file name extension to a folder where you run scripts (typically C:\scripts).

  4. To run the script, in the Windows PowerShell console, at the command prompt (that is, PS C:\>), type the following command and press ENTER:

    C:\<path>\<filename>.ps1

To move the Office Web Apps cache database location by using Windows PowerShell

  1. Using Notepad, create a text file and then copy and paste the following script into the file.

    This example moves the cache associated with the http://contoso Web application to the ContosoDB database.

    $webapp = "http://contoso"
    $newDB = New-SPContentDatabase -Name ContosoDB -WebApplication $webapp -DatabaseServer ContosoServer1
    Get-SPOfficeWebAppsCache -WebApplication $webapp | Move-SPSite -DestinationDatabase $newDB
    
  2. Specify the following parameters:

    Parameter Value

    -WebApplication

    Web application URL

    -Name

    Database name

    –DatabaseServer

    Server name

  3. Save the file with a .ps1 file name extension to a folder where you run scripts (typically C:\scripts).

  4. To run the script, in the Windows PowerShell console, at the command prompt (that is, PS C:\>), type the following command and press ENTER:

    C:\<path>\<filename>.ps1