eZ Community » Learn » eZ Publish » eZ Publish Performance Optimization...

eZ Publish Performance Optimization Part 3 of 3: Practical Cache and Template Solutions

Thursday 25 January 2007 2:05:00 am

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

There are numerous caching options with eZ Publish. This section gives an overview of the different cache types, what they do and when you should use them.

Caching elements in the template file

The following diagram shows a typical pagelayout.tpl main template file. Its elements can be divided into the template cache and the content view cache.

Template cache

The cache-block mechanism makes it possible to reduce the processing time of the main template, which often contains a lot of dynamic elements. It is used to instruct the system to store and reuse cached blocks of template code based on different conditions. The cache-block mechanism is described later in this article.

Content view cache

Recall from the second article in this series that the viewcache stores the HTML/XHTML output from a node view the first time it is accessed (and is thus dynamically generated). For subsequent page requests, eZ Publish serves the particular page from the viewcache, reducing server load and page load times. eZ Publish automatically clears the cache when new content is published or modified.

PreViewCache

When this setting is enabled, the system generates the viewcache when an object is published, as opposed to when it is first accessed. Enabling PreViewCache can slow down the publishing process, but it is useful on busy sites to ensure that an uncached article cannot be accessed at the same time by several people (as is the case with the viewcache); it would have been cached before the first article view. PreViewCache is a sub-setting for the viewcache, and therefore only has an effect if ViewCaching is enabled. For maximum performance on a production server, template cache and viewcache should always be enabled. Below are the recommended configuration settings:

site.ini.append.php: 
[ContentSettings] 
ViewCaching=enabled 
PreViewCache=enabled   
 
[TemplateSettings] 
TemplateCache=enabled 
TemplateCompile=enabled 
TemplateOptimization=enabled

TemplateCompile and TemplateOptimization will be explained in the template section in the second half of this article.

36 542 Users on board!

Tutorial menu

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)

Proudly Developed with from