eZ Community » Learn » eZ Publish » eZ Publish Cache In Details:...

eZ Publish Cache In Details: Template-block Cache

Thursday 02 May 2013 8:56:14 am

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

This series of articles provides a rather advanced clarification on the operations of the cache in eZ Publish. This article if the second of the series, 2 others to come, stay tuned.

Don't forget to read the previous parts of the series:

Download as PDF

Goal description

This series of articles provides a rather advanced clarification on the operations of the cache in eZ Publish, with a particular focus on:

  • the « INI cache » : PHP caching  of the settings
  • the « template cache » : compilation of *.tpl into *.php
  • the « view cache » :caching of content stored in eZ Publish into an xHTML output
    (or others)
  • the « cache-block », caching of the « template-block », bits of xHTML (or others) contained in the templates, and out of reach of the view cache (pagelayout.tpl, personalized module templates, etc.)
  • the role of the expiry.php file
  • the detailed operation of the ezcache.php script

This series of articles will attempt to avoid explaining once again what is already comprehensible and has been fully described in other tutorials or official documentations, it aims:

  • to explain how eZ Publish manages “low level” cache features that it offers : this is the “documentation” aspect of the articles
  • To deduce a possible impact, a possible good or bad practice in the use and combination of the proposed parameters : this is the “tutorial” aspect of the articles

To all those who consider that eZ Publish cache management is complex and / or problematic, it is also necessary to consider the following :

  • This tutorial exists (and this is a big difference), thank you for reading, critique, complete and tracing any questions or errors detected
  • eZ Publish is resource intensive (including SQL) due to its way of storing data : the concept of class and the concept of EAV (Entity / Attribute / Value) is the price to pay to
    enjoy the magical concept of “content classes”, the functional stability or even the possible version upgrade starting from the origins of this CMS (stable & universal data model)
  • Other “competitor” CMSs have a reputation to offer an easier to handle cache management simply because of the lack of actual cache management (usually a simple TTL, a delegation to Varnish, the absence of cache in authenticated mode...

Note: The mechanisms and examples described are based on version 4.5+ Enterprise of eZ Publish or eZ Publish 2012.x Community (until 2012.8 or later in the Legacy Stack part of the builds).

 

Introduction

eZ Publish is an infinitely flexible and powerful CMS that powers a wide variety of websites with low or high traffic. This power comes with a price: resource consumption in general, and SQL resource consumption in particular, as well as disk I/O ! All these mechanisms have to be controlled to size its architecture, or understand the impact of a parameter, of a cache-block directive or even a massive removal of cache (template, cache-block or view cache).

The previous article detailed the way INI cache and template compilation cache work. This article details one of the central mechanisms of eZ Publish, very impacting on performance: the viewcache (or content cache according to the translation that we want to give to content view cache). Next articles detail the cache-block, the expiry.php role, the ezcache.php script and a performance simulation.

 

Pre-requisites and target population

This series of articles is aimed mainly to:

  • Developers / administrators with an advanced knowledge of eZ Publish
  • Developers of high traffic websites or in search for a performance boost
  • Developers who want to make peace with their server administrator / host
  • Eco-conscious citizens, worried about wasted energy (or murdered Pandas!) caused by the rebuilding of view or template-block caches

WARNING: Reading this tutorial may be particularly painful and requires concentration and a long-lasting patience. It is advisable to read it in multiple sessions, equipped with a beer or a good bottle of wine for the wealthiest among us.

 
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