Caching Features in SharePoint 2013

In this article, we will see the various ways to cache SharePoint objects that improve the performance of SharePoint Applications.

The following are the available cache settings for SharePoint Server 2013:

  1. BLOB Cache
  2. Page Output Cache Profile
  3. Object Cache
  4. Anonymous Search Results Cache

BLOB Cache

This functionality is a disk-based cache that increases Farm capacity and throughput, and supporting digital media assets.

The primary goal of the BLOB cache is to increase the capacity of the Farm by reducing the load on the Content Database. It caches the frequently used JavaScript files, media, audio and video files. When the page is requested for the first time, all the resources are pulled from the database server and moved to a blog cache enabled on the Farm web server and the subsequent requests are served from the BLOB storage in the web server. This reduces load and network traffic on the database server.

To enable the BLOB Cache, use the following config setting in the Web. Config of the web application.

<BlobCache location="C:\Lakshmanan " path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="true" />

  • Location: It specifies where the caching is done
  • Path: It gives you the list of file extensions that can be cached.
  • maxSize: Indicates the maxSize allowed
  • enabled: By default its false. BLOB caching is enabled by setting its value to true.

To flush the BLOB Cache:

$webApp = Get-SPWebApplication "<WebApplicationURL>"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)
Write-Host "The BLOB cache is Flused for:" $webApp

A BLOB Cache must be flushed if the content database is restored.

Page Output Cache Profile

It stores the various versions of the rendered SharePoint page. It works with Cache profile for caching the various SharePoint objects like Pages, Layouts, and Images.

Cache profiles describe specific cache settings for each type of page output cache. Cache profile settings can be configured in the user interface at the site collection level by a site collection administrator, and also 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.

Cache profiles can be configured by specifying the following parameters in the Central Admin.

  1. Display Name
  2. Display Description
  3. Perform ACL Check
  4. Enabled
  5. Duration
  6. Check for Changes
  7. Vary by Custom Parameter
  8. Vary by HTTP Header
  9. Vary by Query String Parameters
  10. Vary by User Rights
  11. Cacheability
  12. Safe for Authenticated Use
  13. Allow Writers to View Cached Content
  14. Object Cache
  15. Anonymous Search Results Cache

Object Cache

This method is used for storing objects such as lists and libraries, site settings, and page layouts front-end web farm server. As a result, the pages that require these items can be rendered quickly.This feature can be activated only if you are using a publishing site.

The object cache settings can be configured at the site collection level 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.

Anonymous search results cache

If the anonymous user does a SharePoint search in a publishing site then performance can be improved by an anonymous search results cache. It saves search results from anonymous users and reuses them for later search queries. This improves performance on publishing site pages that use the Content Search Web Part.