Share » Learn » eZ Publish » eZ Publish: Performance Best Practices

eZ Publish: Performance Best Practices

Friday 28 April 2006 1:10:00 am

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

From the point of view of performance, the most important part of the specification process is selecting and defining the caching mechanisms that eZ Publish will use. Caching must be considered during each stage of development and deployment, and has a critical impact on performance.

Cache types

Templates and configuration files

The Template Compilation and Override Cache settings may be disabled during development as described in the documentation of the site.ini. These settings should never be disabled in a production environment, because that would considerably slow down your website. For example, the Template compilation cache drastically reduces server load, because it generates pure PHP scripts from the eZ Publish template, so there is no need to parse the templates during production runtime.

The upcoming version 3.8 of eZ Publish introduces template development mode, which negates the need to disable these settings.

Content

ViewCaching is the fundamental mechanism for content caching, and should always be enabled. However, ViewCaching can be disabled for individual pages if required. When enabled, eZ Publish will automatically create multiple cached versions based on roles and the view parameters.

Cache blocks are used to cache dynamic parts of pagelayout.tpl and dependent templates (that is, templates that are not handled by ViewCaching). They store the HTML result of dynamically generated template code in a text file. This file can be loaded the next time the same code is requested. As an example, cache blocks are often used to store navigation menus. Note that too many cache blocks can have a negative effect on performance. More information on the proper use of cache blocks can be found in the eZ Publish documentation.

Finally, static caching is the most powerful cache mechanism for many projects. It stores and reads static HTML files, so that PHP is not called when a page is loaded. Performance can be boosted tremendously by using static caching, but you have to determine during the early stages of the project where it should be implemented, what parts of the project cannot use it and how cache expiration should be handled.

Caching strategy

The cache strategy that will be used is directly dependent on the project specifications. For example, features that display personalized information cannot use StaticCache. Content that performs real-time rendering cannot use cache blocks. Therefore, the eZ Publish implementer needs site specifications in order to identify the best cache solution. These specifications don't need to be overly documented or obscure, or rely on a complex development process; they merely need to be factual and efficient. For example, a simple website will have a very short specification.

eZ Publish 3.8 will have new features that allow header alteration and make use of an external caching system like Squid. More information on these features will be published in the near future.

36 542 Users on board!

Tutorial menu

Printable

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

Author(s)