Configure L2 cache settings

Overview

L2 cache in Sitefinity CMS is used to cache database query results for subsequent requests. Using L2 cache can significantly increase the overall performance of your application. For example, when you open the list of news items in the backend for the first time, data is requested from the database to populate the list. Sitefinity CMS underlying ORM caches the data and subsequent request return the cached response.

Enable and disable L2 cache

The L2 cache in Sitefinity CMS can be enabled or disabled via changing the Enable data caching property available under Administration » Settings » Advanced » Data. The supported values are:

  • True  - L2 cache is turned on
  • False - L2 cache is explicitly disabled

NOTE: By default, the value of this property is left empty. This means that Sitefinity CMS will automatically determine the best setting, depending on the hosting scenario.

Configure L2 cache strategies

You can configure the L2 cache settings per persistent type - both in Network Load Balanced (NLB) environment as well as single instance environment.
By default, caching is enabled for all persistent types. By configuring the L2 Cache Strategies setting, you can specify which persistent types not to use the L2 cache.

RECOMMENDATION: It is recommended to have the L2 cache turned on for all persistent types and disable it only for testing purposes.

Configure the L2 cache strategy for a specific persistent type

  1. In Sitefinity CMS backend navigate to Settings » Advanced » Data » Database Mapping Options » L2 Cache Strategies.
  2. In the CLR Type field, enter the class name of the persistent type whose L2 cache strategy you are configuring.
    For example, Telerik.Sitefinity.News.Model.NewsItem
  3. In the Cache Strategy field, enter one of the following:
    • Yes or blank - L2 cache is enabled for this type
    • No - L2 cache is disabled for this type
  4. For your changes to take effect, restart your application.

When you change the L2 cache strategy for a specific content type, the strategy does not automatically apply to any related types. For example, if you disable the L2 cache for the Blog content type, you actually do not disable the L2 cache for the Blogpost content type. To disable L2 cache for the Blogpost type, you need to explicitly do so.

NOTE: Turning off L2 cache for the DynamicContent type turns it off for every artificial type created with the DynamicModule builder.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?