PHPRO.ORG

The eZ Components camp is once again pushing the limits of PHP, this time by extending the already flexible caching component to greater strengths.

New functionality currently being developed for Cache 1.4 is set to realize hierarchical caching for the eZ Components system. What sounds like a simple addition is, in fact, quite difficult to implement in a fast an efficient way. The possibility to choose cache types raises further issues with regard to possibility to choose from the use cache dependent on the type of item to be cached. Storing user objects on the file system is slow and it may be faster to simply make another call to the database.

Caching images has always been an issue as they cannot successfully be stored in RAM as there is little space for them. However, it has raised the issue of using several caching stacks for different objects and the possibility of a hierarchy as follows.

  1. Local memory. Very fast cache, but very limited
  2. APC on another server. Quite fast, but still limited
  3. HD on and NFS share. Not that fast, but huge

The idea is to store most frequently used data on level 1, still frequently used data on level 2 and not very often used data on level 3. This sort of hierarchical cache would permit a 'bubbling up' effect as more frequently used data bubbles up the stack.

By adding the functionality to distinguish between local-server-only caches and clustered caches, the eZ Cache component would benefit those systems utilizing farms of web servers.

Well done once again Thomas Nunninger, Tobias Schlitt of the eZ Components team have been instrumental in the design of the new features and it is sure that the finished product will be a bonus to those who are coding the eZ way.