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

The transversal role of the expiry.php file

The {VarDir}/cache/expiry.php file was discussed throughout the articles. This file is used for a wide variety of things, for several caching mechanisms, when it comes to provide to PHP a basis for comparison with a timestamp.
For example, when the cache expires globally, rather than to invalidate (unlink, touch, update according to the filehandler) the whole set of cache files (which is impossible depending on the volume), the expiry.php provides an up-to-date timestamp, necessarily superior to all the mtime of the cache files produced so far.
The file consists of a simple key table:

 <?php
$Timestamps = array (
'state-limitations' => 1321010927,
'user-info-cache' => 1323788789,
'content-view-cache' => 1326299075,
'class-identifier-cache' => 1326298969,
'global-template-block-cache' => 1325856140,
'content-tree-menu' => 1326298969,
'image-manager-alias' => 1323788788,
'active-extensions-cache' => 1325668728,
'ts-translation-cache' => 1323788789,
'content-complex-viewmode-cache' => 1325780763,
'template-block-cache' => 1326298969,
'user-class-cache' => 1326298969,
'sort-key-cache' => 1326298969,);
?>

Some of these values have no real impact on performance, they are described briefly here for completeness.

Table of meanings of the couples of value / timestamp:

Key name trigger(s) Usage of the timestamp
state-limitations php bin/php/ezcache.php --clear-id=state_limitations
php bin/php/ezcache.php --clear-tag=content
Editing of a status group of objects
Reading of the limitations of a status group of objects
Expire the caching of a PHP key table describing the limitation on a set of status object in {VarDir}/cache/statelimitations_{hash}.php
user-info-cache php bin/php/ezcache.php --clear-id=user_info_cache
php bin/php/ezcache.php --clear-tag=user
Editing / Removal of a rule
Editing / assigning / removal of a role
Removal of a node
Globally expires the users cache (groups, rules, limitations by user)
content-view-cache php bin/php/ezcache.php --clear-id=content
php bin/php/ezcache.php --clear-tag=content
Exceeding of the CacheThreshold at the publication (250 nodes by default).
Editing the roles, assignment of roles, creation / modification of content classes, assignment of sections.
See the chapter describing all the triggers
Globally expires the cache.
See the chapter describing the impact of this expiration on the performances
class-identifier-cache php bin/php/ezcache.php --clear-id=classid
php bin/php/ezcache.php --clear-tag=content
Creation / modification of the content classes
Expires a PHP key table doing the link between the textual and numeric identifier of a class (“user” => “4”) in {VarDir}/cache/classidentifiers_{hash}.php
global-template-block-cache php bin/php/ezcache.php --clear-id=template-block
php bin/php/ezcache.php --clear-tag=template
php bin/php/ezcache.php --clear-tag=content
Expires all the template-blocks caches (the cache-blocks), including those containing the subtree_expiry directive
content-tree-menu php bin/php/ezcache.php --clear-all
php bin/php/ezcache.php --clear-tag=content
php bin/php/ezcache.php --clear-id=content_tree_menu
Allows the Back Office to cache the browser AJAX requests to the content browser.
This value is available in the templates using the {fetch('content','content_tree_menu_expiry')} function
image-manager-alias php bin/php/ezcache.php --clear-id=imagealias
php bin/php/ezcache.php --clear-tag=image
Expires the images alias list defined in image.ini / [AliasSettings]
active-extensions-cache php bin/php/ezcache.php --clear-id=active_extensions
php bin/php/ezcache.php --clear-tag=ini
Expires the caching of a PHP key table doing the list of the activated extensions for each site_acces in var/cache/active_extensions_{hash}.php
ts-translation-cache php bin/php/ezcache.php --clear-id=translation
php bin/php/ezcache.php --clear-tag=i18n
Globally expires the translation PHP key tables, stored according to the site_access in {VarDir}/cache/translation/{hash}/{language}/{hash}.php
content-complex-viewmode-cache Content publication Expires the view caches dependant to a viewmode too complex to be linked to individual files (sitemap for example), according to the paramter : site.ini
[ComplexDisplayViewModes]
template-block-cache php bin/php/ezcache.php --clear-tag=clear-all
Content publication
Editing the roles, assignment of roles, creation / modification of content classes, assignment of section
Expires the whole template-blocks cache (the cache-blocks), except those containing a subtree_expiry directive
user-class-cache Edition of a role
Creation / modification of a class
Expires the session cache determining if the list of classes that the current user can create should be updated or not
This class list is available with the fetch( 'content', 'can_instantiate_class_list' ) function
sort-key-cache php bin/php/ezcache.php --clear-id=sortkey
php bin/php/ezcache.php --clear-tag=content
Creation / modification of a class
Globally expires the datatype PHP key table linked to each sort for each datatype (“ezstring” => “string”) in {VarDir}/cache/sortkey_{hash}.php
ezpRestRouteApcCacheKey php bin/php/ezcache.php --clear-id=rest-routes
php bin/php/ezcache.php --clear-tag=rest
Related to the REST API and the removal of APC routes, not tested

 

 
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