Share » Learn » eZ Publish » eZ Publish Performance Optimization...

eZ Publish Performance Optimization Part 3 of 3: Practical Cache and Template Solutions

Wednesday 24 January 2007 5:05:00 pm

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

There are several caches dealing with internal eZ Publish features that you should enable in order to improve site performance.

Role caches

site.ini.append.php: 
[RoleSettings] 
EnableCaching=enabled

As soon as a new user (registered or anonymous) visits the site, eZ Publish will check whether there is a cached file on disk containing pre-calculated user permissions. If the file does not exist, eZ Publish calculates the new permissions and saves these to a file. On sites with complex role systems, the role cache can reduce the time spent on calculating permissions. The cached file is saved on the file system under the directory var/(site)/cache/user-info. Here is a role cache file example for an Administrator user (object id 14):

user-14.cache.php:  return array ( '*' => array ( '*' => 
array ( '*' => '*', ), ), ); ?>

Translation cache

site.ini.append.php: 
[RegionalSettings] 
TranslationCache=enabled

The translations of GUI labels in eZ Publish are stored in XML files for each language. When TranslationCache is enabled, the translation cache system will parse the XML translation file (translation.ts) and compile it to native PHP files for faster execution. This significantly reduces load time and should always be used. The translation cache is stored on the file system under the directory var/(site)/cache/translation/. The example below presents one node from the translation.ts file and its PHP equivalent:

translation.ts    Current location  Obecna lokalizacja     
Cached translation file: array (  'context' => 'design/admin/pagelayout',  
'source' => 'Current location',  'comment' => '',  
'translation' => 'Obecna lokalizacja',  'key' => 
'2efc78139d269b1f0ebf88225e7e20c7',  )

Template override cache

site.ini.append.php: 
[OverrideSettings] 
Cache=enabled

Data such as template override rules is rather static. If the template override cache system cannot find the override cache file, it will generate a new one and store it to disk. This increases performance because eZ Publish does not have to read override.ini(.append.php) files on each script invocation. The override map is stored on the file system as native PHP under the var directory (var/(site)/cache/override/). One override cache file is generated per siteaccess.

36 542 Users on board!

Tutorial menu

Printable

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

Author(s)