Disable output cache for backend users

The Sitefinity CMS output cache mechanism invalidates a page from cache when someone edits the page or one of the cache dependencies for that page, for example the template it’s based on or some of the content items displayed on this page. When someone request the page for the first time, Sitefinity CMS creates a cache item, and serves the page from cache for consecutive requests. This behavior helps serving pages faster and guarantees the website scalability. However, there are cases, where you might want to prevent creating a cached item of the page. For example, when a backend user is editing a page and they view it to observe the changes they’ve made, by default their request creates a cached version of the page, and this version is served to all users afterwards until the cache of the page expires. This behavior might be undesirable for two reasons:

  • Administrators, and other backend users might prefer to always see the latest version of the page, for example if they are making changes to a widget template through code and want to see these changes immediately reflected. Thus, it’s better if pages are not cached for logged in users in this role.
  • Administrators, and other backend users might have extended permissions to see content, which should not be seen by other roles or non-authenticated users browsing the site. If they create the cached version of the page by viewing it, then some content might be displayed to frontend

Select which logged in users should have output cache disabled

By default, Sitefinity CMS disables output cache for logged in users in the following scenarios:

  • If you have Inline Editing enabled, users who have rights to perform Inline Editing have output cache disabled. By default, Inline editing is disabled for new projects, created with Sitefinity CMS versions 12.0 and later. For more information see Inline editing.
  • Logged in users with Administrators role have output cache disabled.

You can customize the default behavior and manually configure the default set of roles, for which output cache is disabled. To do that, follow these steps:

  1. In your Sitefinity administrative backend navigate to Administration » Settings » Advanced
  2. From the treeview select Pages
  3. From the Pages advanced settings list, locate the Disable output cache for dropdown
  4. Select one of the following options:
    1. None – This option instructs Sitefinity CMS to always use output cache
    2. Administrators – this is the default value, and instruct Sitefinity CMS to disable output cache for logged in users in Administrators role
    3. BackendUsers – select this option to instruct Sitefinity CMS to disable output cache for all logged in users who can access the website backend
  5. Click Save changes

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?