Caching options

 

Global caching settings

 

Go to CMS Site Manager -> Settings -> Web Site, choose your web site from the drop-down list. You can configure the following values:

 

Cache content (minutes) - this option specifies that all web parts/controls should cache the content they retrieve from Kentico CMS. You can override this value by setting the Cache minutes property of the web parts to 0, which disables caching for the given control, or generally to some different number of minutes. It's recommended that you cache all possible content that is not modified too often. The drawback of this option is that when you modify some content, the changes appear on the live site after the old version expires in the cache.
 
Cache images (minutes) - this option is used only for caching of images. It's recommended that you always use it. Kentico CMS automatically  removes the cached image when it's modified, so it doesn't cause displaying of outdated content.
 
Cache page info (minutes) - this option is used for caching of page content and metadata. Since Kentico CMS often retrieves page information many times during a single page processing, it's actually a must to always set this value to at least 10 minutes! Kentico CMS automatically removes the cached page when it's modified, so it doesn't cause displaying of outdated content.

 

 

Web part/control-level caching settings

 

Some web parts/controls used for displaying content have two properties related to caching:

 

Cache minutes/CacheMinutes - this property specifies for how long the web part should cache the content retrieved from Kentico CMS. The default value is defined in the Cache content (minutes) site settings value described above. You can override the global value by setting this property to a different number.
 
Cache item name/CacheItemName - this property specifies the key name under which the content will be stored in the cache; if not specified, the system generates the key name automatically based on the site name, page path, web part ID and current user name.

 

 

Full-page caching

 

Full-page caching represents the most powerful option. It caches the whole page, so it's not necessary to contact the SQL Server and run the page code again when the page is requested second time. You can configure the full-page caching in CMS Desk -> Properties -> General. The configuration is automatically inherited to child pages unless you disable caching on them.

 

The page stored in the cache is automatically removed when you modify the given page. However, if the page displays other documents (such as news list) and you modify these documents, the page will not be updated.

 

This option is not suitable for pages with web parts that need to be refreshed very often (e.g. the Random document web part) since you cannot disable caching for particular web parts. For such pages, it's recommended that you do not use full-page caching and use content caching instead.

 

 

Caching and personalization

 

If your web site contains sections for site members, the caching will be personalized, which means each signed in user will have his/her own cache. This may lead to large memory consumption, so it's recommended that you set caching to lower values for membership sites.

 

 

Previewing modifications made to pages with caching

 

Caching may confuse the content editors since they will not see the changes they made on the live site immediately. In such case, they can preview their changes in the Preview mode in Kentico CMS Desk since this mode doesn't use caching. The Edit mode doesn't use caching either.

 

 

File management and performance

 

The files can be stored in file system (faster) or in database.If you're experiencing problems with slow image viewing, please try to configure the following values in the Site Manager -> Settings -> Files section:

 

- Generate thumbnails: yes

- Redirect files to disk: yes

- Store files in file system: yes

 

You can find more details on file management in chapter Where the files are stored.