Pre-generation of view cache
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.
Svitlana Shatokhina (23/10/2006 12:59 pm)
Geir Arne Waaler (13/09/2010 4:25 pm)