Caching is just one part of many factors that help us speed up the page loading time in our SharePoint, and the Cache settings itself consists of several different types of cache, some are easy and some are more complex with dependencies to other factors.

We have three types of Cache to deal with:

  • Blob Cache
  • Object Cache
  • Output Cache and the Page Layout Cache


Blob Cache

Disk-based caching for Binary Large Objects
Blob cache manages the cache for pictures, video files, images, audio files, CSS files or script files. It is disabled by default in a clean SharePoint installation. When the Blob cache is activated, it gives faster response times for files stored in the front-end Web server, which means that traffic to the database is reduced significantly. The setting made in the blob cache is for all site collections in the web application. So there is only one blob cache per web application.

Before you decide to activate the blob cache, the following should be considered:
Is it an Intranet where files constantly are updated, you should not cache these types of files that are updated frequently. Is there a public Web site where anonymous users only have read-only access, or when dealing with relatively static files, you should use the Blob cache.

Follow these steps to activate the blob cache:

  • Locate currently webconfig file
  • Before you do anything, take a copy of webconfig file first in case something goes wrong when you edit the file. Then, open the file with for example notepad and locate the following line:
    <BlobCache Location=”C:\blobCache” path=”\.(gif|jpg|png|css|js)$” maxSize=”10″ enabled=”false”/>
  • Change enabled to true
    <BlobCache Location=”C:\blobCache” path=”\.(gif|jpg|png|css|js)$” maxSize=”10″ enabled=”true”/>
  • You can then choose which file types you want included in blob cache, i.e. you can add PDF E t c.
  • Perform an IIS reset

Sometimes the cache mechanisms can go in a locked mode. The key is then to flush (empty) the cache on the current site collection. Release this via disk based cache reset, just go to:
Site Collection Administration, Site collection object cache, disk based cache reset.
If you have multiple site collections, you can use STSADM to flush the cache blob per web application.
STSADM-o SetProperty-blobcacheflushcount property name-property value 11-url http://nameofthewebbapp:portnumber
As an alternative to STSADM, there is a solution for this on Codeplex called MOSS 2007 Farm-Wide BLOB Cache Flushing Solution, that allows you to flush all the Web applications in a farm.

Screenshot of the MOSS 2007 Farm-Wide BLOB Cache Flushing Solution

Public website with Anonymous access
Style Library (and the Master Page Gallery) in MOSS does not work for anonymous visitors per default. You must therefore set Style Library to anonymous access, so the cache can work for the content of this directory. Is the cache already at on from the beginning when the Style Library supplemented with anonymous access, be sure to clear the cache after this addition.

Take a note

  • If you store the SharePoint logs (ULS) on the same disk that you store the blob cache you can get less performance.
  • Default cache size is 10 GB (MaxSize). Make sure you have enough of disc, you should have at least 20% more disk than the cache size. You can also specify another path to another drive (location).
  • Make sure not to have too small size of the cache, it may degrade performance.
  • MaxAge is another attribute you should consider using. Maxage put a time interval in seconds that the client’s browser cache is what is in the blob cache.
  • If you want to inspect the effect of the blob cache, you can use the tool Fiddler

Blob caching and throttling Bit rate in SharePoint 2010
BRT is an extension to IIS 7 that comes with IIS Media Services-operation, which allows you to control and monitoring bandwidth for streaming video in SharePoint 2010. The blob cache has to be activated with the right file extension for the type of video file to stream, in order for BTR to work.

Cache Profiles
There are some prebuilt profiles that are configured with optimized settings. For example, a public Web site with anonymous user or an intranet with authenticated users. You can, if necessary, create their own profiles with customized settings based on your scenario.

Screenshot of the settings for the Intranet profile


Object Cache

Object Cache should be activated in all SharePoint environments. This type of cache stores properties for sites and pages, and reduces the traffic between the Web server and database, it also cache cross-list Queries and navigation elements. Basically the higher the value you set, the better performance, but to the cost of RAM. For cross-list queries, a multiplied value can be set, the higher value (1-10)  the more memory are will be in use. A higher value is recommended if you have much different unique permission settings, or for example one or more instances of CQWP. Not at least in a larger environment with a deep site structure, where SharePoint needs to look at maybe many thousand rows in the database. Be sure to hold down the number of instances of CQWP, and try to use the filter.

Follow these steps to activate the object cache:

  1. Site Settings> Site collection object cache> Object Cache Size = Enter the size in MB, can be higher if enough memory is available.
  2. Site Settings> Site collection object cache> Cross List Query Cache Changes = Use the cached result of a cross list query for this many seconds. 


Output Cache

Output Caches stores HTML structure, controls, web parts or whole pages.
Particularly well suited for public Web sites. The output cache needs a lot of RAM memory. Activate this cache for authenticate users; the cache is stored by individual users.

Follow these steps to activate the Output cache:

  1. Site Settings> Site Collection output cache
  2. Select the Enable output cache
  3. Select profile. Applies to a public Web site puts you Anonymous for Public Intranet
  4. Select last Enable debug cache information for later if you may need to examine the cache.

Page Layout Cache

Should be activated, because this type of page is rarely updated and is of static type.
Follow these steps to activate the Page Layout Cache:

  1. Go to Site Settings
  2. Click Master pages and page layouts in Galleries
  3. Select Edit properties for the page layouts you want to cache
  4. Enter the Public Internet for Anonymous Cache Profile
  5. Click OK. Make sure the page is checked in to a Major Version and approved, if this are requiring in this directory.

Performances in general
There are a lot of other configurations existing built-in mechanisms in SharePoint, which as cache settings affect performance.

Some examples:

  • How SQL Server is optimized. Read the Microsoft’s best practices to plan and monitor for optimal performance of SQL from a SharePoint perspective:
  • How the environment overall is planned and dimensioned.
  • If SharePoint server contains the latest SP and patches.
  • Server capacity, broad band and client.
  • Individual permissions for each web site or list
  • Crawl settings with too short time interval.
  • Reading data from a list can require resources if the filter is not used, or if the indexing of columns is activated for lists with many items.
  • Heavy graphics on the page, or if images are not optimized in the best way, or if the page contains Flash animation e t c.
  • Optimization of HTML structure.
  • Optimized CSS files.
  • Closed web parts.
  • Activated features that are not used.
  • Too many active workflows.
  • Custom Web Parts that is not optimized.
  • NTLM authentication instead of Kerberos.