This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

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

eZ Publish Cache In Details: expiry.php and ezcache.php command

Wednesday 05 June 2013 2:46:43 pm

  • 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 last of the series.

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).



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 articles detailed templates compilation, view caches and how to optimize template-block caches to ensure the sustainability of an eZ Publish project over time. This article, that closes the series of four articles on eZ Publish caches, details the role of the expiry.php file and the way the ezcache.php script works.


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


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


Proudly Developed with from