Two cache types... and a third one!

As stated above, all recent Joomla releases give the user the choice between two cache systems: a global system cache (accessible under control panel – system settings) and a plugin-based cache.

The first one work a the MVC level – it cache the output of single element, as modules and components. The second one work at the web page level – it cache the entire page output, presenting it to the next visitor without re-rendering the page.

While different, the two cache system both share some common drawbacks: most important, they only work for guest (not-logged-in) users. Moreover, the global cache system is module dependent, and some modules require it to be disabled for correct operations (it can be enabled / disabled on a module base). While a complete examination of the various drawbacks of the two cache modes is beyond the scope of this article, you can find more information reading the links in the “References” section in the last page.

For now, simply keep in mind that both Joomla cache types work by caching the HTML code produced by a module or by an entire page.

A third type of cache is something not directly regarding Joomla, but PHP itself. As you may know, PHP is an advanced scripting language, so it compiled to machine code “on the fly” (eg: when the script run). In this process, the source PHP code is first parsed and translated in a intermediary form called bytecode, which is then compiled to machine code. If we can cache this intermediary step, keeping a copy of the parsed bytecode for later usage, we can speedup thing noticeably. The so called “PHP-accelerators” do exactly this thing (some advanced accelerator also cache the resulting machine code, for faster execution).

A good, free and open source PHP accelerator is APC – the alternative PHP cache. In order to provide you somewhat more comprehensive results, I run the test with and without this accelerator.