Configuring caching

Libraries, such as image or video libraries, support output (server) and client (browser) caching. Configuring caching increases your performance.

Output and client caching are controlled with cache profiles, which you can configure in the following way:

  1. Click Administration » Settings.
    The Basic Settings page appears.
  2. Click Advanced link.
    The Settings page appears.
  3. In the left pane, click System » Output Cache Settings.
    The following globally available caching profiles appear:

    Type of caching Available profiles 

    Output Cache Profiles
    • No caching
      The output caching is disabled for this profile. Output will not be cached.
    • Standard caching
      This is the default profile for all content. It is set to expire in 120 seconds and SlidingExpiration is enabled.
    • Long caching
      It is set to expire in 1 200 seconds, absolute time.

    Client Cache Profiles
    • No caching
      The client caching is disabled. No expiration of the content will be set and the actuality will be verified for every page request.
    • Standard caching
      This is the default profile for all content. It is set to expire in 90 days from the request.
    • Long caching
      It is set to expire in 1 year from the request.

    These profiles are applicable to page and content caching.

You can set cache profiles to individual pages or libraries, using the Advanced options of a page. If no profile is set to a page or library, the default profile is applied. You can change the default profiles and you can globally turn on and off output and client caching, regardless of individual settings made on pages and libraries.

Setting the size of memory used for caching

You can set the max size of items to be cached. Items, larger that the predefined size, are not cached.

You can set this, using the cache profiles, described above.

NOTE: The maximum amount of memory to be used for cache is equal to the maximum size of items cached, times the number of pages.

You can set the maximum cache size for Sitefinity on application pool level in IIS. This setting is useful when you have multiple sites hosted on the same server and you want to set a limit on the resource use for each site. This way, the application pool automatically resets itself when its size limit is reached. 

To set this, perform the following:

  1. Open IIS Manager.
  2. Expand you server node and click Application Pools.
  3. Select your application pool and in the right pane, click Advanced Settings.
  4. Under Recycling you can set the Private Memory Limit.

Level of caching

Output caching is done at the page level where Sitefinity caches all rendered output (including widgets). On the widget level Sitefinity performs cache substitution, whenever a widget has an inherent dynamic behavior. For example, in the case of the login name, login status, etc. Sitefinity performs post cache substitution – these widgets are written using Razor syntax and right after the cached page is about to be served, Sitefinity injects the string that the widgets output into the response.

Caching custom controls

If the site is configured to use output caching, custom controls are cached with the entire page. You can disable caching page by page and you can also leverage the post-cache substitution mechanism. Sitefinity exposes a class called CacheSubstitutionWrapper and you can make your own use of this infrastructure, if you wanted to inject dynamic content onto cached pages, without hindering performance.

Cache expiration

You set cache expiration using the caching profiles, described above. You can the assign different profiles to different pages, using the Advanced options of a page. You can also programmatically expire cache using  public void CacheManager.Remove (string key) where key is the ID of the page node.

Output caching for RSS

The output of RSS feeds in Sitefinity is cached the same way as the page output caching.

Output caching in RSS results in less database queries and improves the overall performance of the website. 

The RSS caching is not automatically invalidated upon a change in the content that is published in the feed.  This means that until the cache expires (sliding or absolute) the feed will not be updated.

The caching profile of the RSS is set for all RSS feeds. 

To setup the caching of the RSS feeds, perform the following:

  1. Create an output caching profile for the RSS feeds.
    Perform the following:
    1. In the main menu, click Administration » Settings » Advanced » System » Output Cache Settings » Output Cache Profiles » Create new.
    2. Enter the setting of the profile.
      We recommend to use absolute expiration by deselecting Sliding expiration checkbox. Without automatic cache invalidation, sliding expiration can result in very long periods of non-updated feeds.
    3. Click Save changes.
  2. Assign a caching profile for RSS.
    Perform the following:
    1. In the main menu, click Administration » Settings » Advanced » Publishing.
    2. In Output caching profile to be used for caching the feeds output field, enter the name of the profile that you created.
      You can also use one of the existing caching profiles.
    3. Click Save changes.

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK