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:
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.
Full client cache
You can enable full client cache by adding the following key into the configuration/appSettings section of your web.config:
<add key="CMSFullClientCache" value="true"/>
If you enable this type of caching, CSS styles and images will be cached in the client browser. This type of caching can be useful only for live site displaying, as changes made to the page in non-live-site modes would not be displayed due to the caching.
Web part/control-level caching settings
Some web parts/controls used for displaying content have two properties related to caching:
If you check the Use default cache dependencies check-box, default settings will be used. The default settings are configured for each web part and include all possible object changes that the content of the web part could depend on.
Example 1: let's presume that you have a web part displaying some information about users. Therefore, whenever some user gets its details modified, the web part's cache should be cleared. To assure this, you need to enter cms.user|all into the field, which is the dummy key that would get touched whenever some users' details get changed.
Example 2: now let's presume that your web part is displaying information about one particular user - the administrator. Her user name is administrator, her ID is 53 and her GUID is something beginning with 1ced44f3-f2fc. So if you want to have the cache cleared whenever this user's details are changed, you can use any of the following three keys that are specifying the user by the previously named properties:
Partial caching
Partial caching is, simply put, full-page caching for web parts. Like with full-page caching, partial caching also stores the output HTML code. But in this case, it doesn't store the whole page, but only the output HTML code of the particular web part. The web parts have the Partial cache minutes and Partial cache dependencies properties, which can be used the same way as the Cache minutes and Cache dependencies properties described above.
Please note: default partial cache dependencies are not specified for the web parts, so if you want to use this feature, you need to specify them manually by entering the dummy keys as described above.
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:
You can find more details on file management in chapter Where the files are stored.
|