Zend Cache Review - Overview (
Page 3 of 10 )
Note: This is an educated guess at how the Cache works based on the
way the two open source cache's work and some of Zend's online
documentation.
To understand how the Zend cache works, it is first important to understand how the
Zend engine (the scripting engine that powers PHP 4) works. What the Zend engine
does (in a very basic sense), is given a PHP file, parses it, and builds a complex
data structure based on the php file given to it (known as an op structure). Then it
goes through this op structure, and executes it, performing the various calls (such as
database connections, etc.) and functions defined by the op structure.
What the Zend Cache does is eliminates the need for the Zend engine to constantly
re-compile (parse the php file into an op structure) a php file, by storing the
compiled results either in shared memory or in mmap'd files (beyond the scope of this
article, for more information "man mmap"). As file size and script complexity increases,
this leads to significant speed increases.
In addition to cache'ing the compiled version of the script, the Zend Cache performs certain
execution optimizations on the code (not present in its competitors), cutting down on the execution
time of the program as well. This added bonus is a really nice feature, and probably a major
contributor to the blazing speed the cache provides (note that this feature alone is available
with the Zend Optimizer, a free product from Zend).
The Zend Cache also includes an online interface which allows you to set configuration options
such as how much memory the cache uses or whether or not to validate the timestamps
of the files being cached. This online interface also provides a plethora of other
information which can help you cut the speed of your applications. Some of these include cache
activity, a list of most requested scripts, most memory intensive scripts, etc. You can view an
online demo, at
http://www.zend.com/cguidemo/.