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

Good practices as well as a few tips and tricks provided in this section will make implementing the site specification easier, less error-prone and improve site performance.

Project components should always be as well-organized as possible. Store your project design and extensions in the extension directory, not in the directory that stores the default design. This will simplify migration and upgrades and make the project layout easier to understand.

Use a consistent and clean directory and file structure. Use consistent naming conventions. For example, use either underscores or camel case for the template names, not a mix of both. Do not keep backup files of templates in the "live" area, and clear deprecated files as soon as possible to avoid accidentally maintaining unused files.

Tips and tricks

These tips and tricks will make the implementation of your site smoother:

$node

The $node variable is generated by the content/view module. It is therefore available in most pages during development. However, it should never
be used in any templates other than the one that overrides the node/view/* template. When ViewCaching is enabled, the variable will no longer be available after the cache is generated, as the content module is not going to fetch the Node object from the database.

AvailableSiteDesignList

Located in content.ini, the AvailableSiteDesignList[] array lists the designs the system should include when clearing ViewCache. If your custom design name is not listed in your override configuration file, ViewCache files won't be cleared when content is published.

Cache blocks

Cache blocks will mostly be used to cache pieces of template code that are not handled in templates cached by ViewCache (for example, a navigation menu's contextual information such as the latest news, connected users and the latest forum posts). Ideally, all calls to the fetch and content template operators should be embedded in a cache block.

In most cases, cache block expiration is handled using time expiry (TTL) or subtree expiration. Time expiry sets the lifetime of a cache block in seconds. For example, if it is set to 3600, the block will be renewed after one hour. Subtree expiry is used to expire cache blocks when content is published under a subtree, for instance /products or /content/view/full/50.

Limit the number of cache blocks used on the same page, as the cache blocks themselves have an input/output overhead. When possible, concatenate multiple cache blocks into one, or use nested cache blocks.

36 542 Users on board!

Tutorial menu

Printable

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

Author(s)