Export (0) Print
Expand All

Configure cache settings for a web application in SharePoint Server 2013

 

Applies to: SharePoint Server 2013

Topic Last Modified: 2013-12-18

Summary: Learn how to configure the BLOB cache, page output cache profiles, and the object cache for a web application.

This article describes how to configure the disk-based BLOB cache, the page output cache profiles, and the object cache for a web application in SharePoint Server 2013.

You enable and configure the BLOB cache, and make configuration changes to the page output cache profiles and the object cache in the Web.config file in the web application to which you want to apply those changes. The changes you make to the Web.config file will be applied to all site collections within the web application.

SharePoint Server 2013 includes cache performance monitors that let you verify that the farm cache settings are correct and that the caching is running at maximum performance. For more information, see Monitor cache performance in SharePoint 2013.

NoteNote:
Configuring the page output cache profiles and the object cache at the web application level will supersede any configuration that was made by site administrators at the site collection level or below.
TipTip:
There may be times when 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. For more information, see Flush the BLOB cache in SharePoint Server 2013.

For more information, see Cache settings operations in SharePoint Server 2013.

In this article:

NoteNote:
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:

By default, the disk-based BLOB cache is off and must be enabled on the front-end web server if you want to use it. Use the following procedure to configure disk-based cache settings for a web application.

ImportantImportant:
Before you make changes to the web.config file, make a copy of it by using a different name (for example, web.config1), so that if a mistake is made in the file, you can restore the original file.
To configure BLOB cache settings
  1. Verify that you have the following administrative credentials: You must be a member of the Administrators group on the local computer to configure the BLOB cache settings.

  2. Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

  3. In Internet Information Services (IIS) Manager, in the Connections pane, click the plus sign (+) next to the server name that contains the web application, and then click the plus sign next to Sites to view the web application or applications that have been created.

  4. Right-click the name of the web application for which you want to configure the disk-based cache, and then click Explore. Windows Explorer opens, with the directories for the selected web application listed.

  5. Right-click web.config, and then click Open.

  6. If the Windows dialog box appears, select Select a program from a list of installed programs, and then click OK.

  7. In the Open With dialog box, click Notepad, and then click OK.

  8. In the web.config Notepad file, find the following line: <BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|themedbmp|themedcss|themedgif|themedjpg|themedpng|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv|ogg|ogv|oga|webm|xap)$" maxSize="10" enabled="false" />

  9. In this line, change the location attribute to specify a directory that has enough space to accommodate the cache size.

    NoteNote:
    We strongly recommend that you specify a directory that is not on the same drive as where either the server operating system swap files or server log files are stored.
  10. To add or remove file types from the list of file types to be cached, for the path attribute, modify the regular expression to include or remove the appropriate file extension. If you add file extensions, make sure to separate each file type with a pipe (|), as shown in this line of code.

  11. To change the size of the cache, type a new number for maxSize. The size is expressed in gigabytes (GB), and 10 GB is the default.

    ImportantImportant:
    It is recommended that you not set the cache size smaller than 10 GB. When you set the cache size, make sure to specify a number large enough to provide a buffer at least 20 percent bigger than the estimated size of the content that will be stored in the cache.
  12. To enable the BLOB cache, change the enabled attribute, from "false" to "true".

  13. Save the Notepad file, and then close it.

CautionCaution:
When you save a change to the web.config file, the web application in Internet Information Services (IIS) 7.0 automatically recycles. This recycling can cause a brief interruption in service to sites contained in that web application, and users can lose session state. For information about recycling web applications in IIS 7.0, see IIS Process Recycling (http://go.microsoft.com/fwlink/p/?LinkId=154094).

Cache profile settings can be configured in the user interface at the site collection level by a site collection administrator, as well as at the web application level by an administrator on the front-end web server. The page output cache must be enabled at the site collection level before page output cache profiles can be configured at either the site collection level or web application level. If page output cache profiles are enabled at the web application level, the settings specified in Web.config will be used for all page output cache profiles, overriding any values that have been entered through the user interface at the site collection level.

NoteNote:
To use the page output cache and the associated cache profile settings, you must be using the Publishing feature on your site.
NoteNote:
There is a known issue with the Content Search Web Part. The SendContentBeforeQuery setting in the Web Part does not work correctly on pages that use output caching. This issue is resolved in the SharePoint Server 2013 cumulative update for March 2013. For more information, see Microsoft Knowledge Base article 2767999: Description of the SharePoint Server 2013 update: March 12, 2013.

Use the following procedure to configure the cache profile settings for a web application.

ImportantImportant:
Before you make changes to the web.config file, make a copy of it by using a different name (for example, web.config1), so that if a mistake is made in the file, you can restore the original file.
To configure page output cache profile settings
  1. Verify that you have the following administrative credentials: You must be a member of the Administrators group on the local computer to configure the cache profile settings.

  2. Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

  3. In Internet Information Services (IIS) Manager, in the Connections pane, click the plus sign (+) next to the server name that contains the web application, and then click the plus sign next to Sites to view the web application or applications that have been created.

  4. Right-click the name of the web application for which you want to configure the disk-based cache, and then click Explore. Windows Explorer opens, with the directories for the selected web application listed.

  5. Right-click web.config, and then click Open.

  6. If the Windows dialog box appears, select Select a program from a list of installed programs, and then click OK.

  7. In the Open With dialog box, click Notepad, and then click OK.

  8. In the web.config Notepad file, find the following line: <OutputCacheProfiles useCacheProfileOverrides="false" varyByHeader="" varyByParam="*"  varyByCustom="" varyByRights="true" cacheForEditRights="false" />

  9. To enable the cache profile at the web application level, change the useCacheProfileOverrides attribute, from "false" to "true".

    NoteNote:
    If you set this to true the settings specified in Web.config will be used for all page output cache profiles. This overrides any values that have been entered through the user interface at the site collection level.
  10. To override the varyByHeader attribute, type a custom parameter as specified in the .NET Framework Class Library entry HttpCachePolicy.VaryByHeaders Property (http://go.microsoft.com/fwlink/p/?LinkId=164238&clcid=0x409).

  11. To override the varyByParam attribute, type a custom parameter as specified in the .NET Framework Class Library entry HttpCachePolicy.VaryByParams Property (http://go.microsoft.com/fwlink/p/?LinkId=164242&clcid=0x409).

  12. To override the varyByCustom attribute, type a custom parameter as specified in the .NET Framework Class Library entry HttpCachePolicy.SetVaryByCustom Method (http://go.microsoft.com/fwlink/p/?LinkId=164240&clcid=0x409).

  13. To override the varyByRights attribute, change the value from "true" to "false". This will remove the requirement that users must have identical effective permissions on all securable objects to see the same cached page as any other user.

  14. To override the cacheForEditRights attribute, change the cacheForEditRights attribute, from "false" to "true". This will bypass the normal behavior in which people with edit permissions have their pages cached.

  15. Save the Notepad file, and then close it.

CautionCaution:
When you save a change to the web.config file, the web application in Internet Information Services (IIS) 7.0 automatically recycles. This recycling can cause a brief interruption in service to sites contained in that web application, and users can lose session state. For information about recycling web applications in IIS 7.0, see IIS Process Recycling (http://go.microsoft.com/fwlink/p/?LinkId=154094).

The object cache settings can be configured at the site collection level in the user interface by a site collection administrator, and is on by default. The maximum cache size can be configured at the web application level on the front-end web server to place a restriction on the maximum amount of memory that the cache will use for all site collections. For example, individual site collections might have the object cache set at 100 MB, while the web application might be set at 1 GB. In this case, no more than 1 GB of memory will be used by all the caches on the server.

NoteNote:
To use the object cache, you must be using the Publishing feature on your site.

Use the following procedure to configure the object cache settings for a web application on a front-end web server.

ImportantImportant:
Before you make changes to the web.config file, make a copy of it by using a different name (for example, web.config1), so that if a mistake is made in the file, you can restore the original file.
To configure object cache settings
  1. Verify that you have the following administrative credentials: You must be a member of the Administrators group on the local computer to configure the object cache settings.

  2. Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

  3. In Internet Information Services (IIS) Manager, in the Connections pane, click the plus sign (+) next to the server name that contains the web application, and then click the plus sign next to Sites to view the web application or applications that have been created.

  4. Right-click the name of the web application for which you want to configure the disk-based cache, and then click Explore. Windows Explorer opens, with the directories for the selected web application listed.

  5. Right-click web.config, and then click Open.

  6. If the Windows dialog box appears, select Select a program from a list of installed programs, and then click OK.

  7. In the Open With dialog box, click Notepad, and then click OK.

  8. In the Web.config Notepad file, find the following line: <ObjectCache maxSize="100" />

  9. To change the size of the cache, type a new number for maxSize. The size is expressed in megabytes (MB), and 100 MB is the default.

  10. Save the Notepad file, and then close it.

CautionCaution:
When you save a change to the web.config file, the web application in Internet Information Services (IIS) 7.0 automatically recycles. This recycling can cause a brief interruption in service to sites contained in that web application, and users can lose session state. For information about recycling web applications in IIS 7.0, see IIS Process Recycling.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft