This part of the 4.x documentation is for eZ Publish 4.0, only reference section is common for all eZ Publish 4.x versions as well as eZ Publish 5.x "LegacyStack", please select the version you are using for the most up to date documentation! |
The "cache on request" approach described in the previous sections supposes that the view cache for a page is created when this page is being accessed for the first time. The additional "cache on publishing" functionality makes it possible to generate view cache files when a node is being created or modified. This makes the publishing process a bit slower (not recommended for sites with lots of content editors), but reduces the access time when the pages are being requested.
The "cache on publishing" feature is disabled by default. This behavior is controlled by the PreViewCache setting located under the "[ContentSettings]" section of the "site.ini" configuration file. Please note that enabling this feature will only affect the view caches generated for the "full" view mode. Whenever an object is published, the system will generate the view cache for all the nodes/locations of this object and their parent nodes. The PreCacheSiteaccessArray setting located at the same place controls which siteaccess(es) the view cache should be generated for (usually public siteaccesses that are used for viewing content).
If you wish to create the view cache files on publishing, add the following lines to the "[ContentSettings]" section of "settings/siteaccess/example_admin/site.ini.append.php" configuration file (replace "example_admin" by the name of the siteaccess that is used for creating and editing content):
PreViewCache=enabled PreCacheSiteaccessArray[] PreCacheSiteaccessArray[]=example
This will enable the "cache on publishing" feature and tell the system that the view cache should be generated for the "example" siteaccess. If you have a news folder containing a lot of articles, editing one of them will lead to re-generating the view cache files of the article itself and its parent (the news folder). When a new article is published in the folder, the system will generate a view cache for the newly added article and regenerate the view cache of the news folder.
Please note that the view cache will only be generated for the Anonymous user by default. This behavior is controlled by the PreviewCacheUsers setting located in the "[ContentSettings]" section of the "site.ini" configuration file.
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.