12.6. Using Different Caching Engines Together

Now at this point, the gears might be turning in your head, and you start to wonder, "What happens if I used more than one caching engine simultaneously?" Well, as you might suspect, a proper choice of complimentary solutions can slightly increase performance, but there are certain combinations that won't do you any good.

JPCache and memcached can play well with others, but APC, eAccelerator, and the Zend Optimizer are somewhat mutually exclusive. While they might load together just fine, and not throw any errors when executing a PHP script, there's little to no reason to use a combination of opcode caches. All three in some way or another provide roughly the same functionality, so using multiple opcode caches will only result in the system being as fast as the slowest cache.

Try to pick just one opcode caching solution, and try combining it with memcached and JPCache. Throw your preferred content-compression solution into the mix—the built-in content compression in JPCache is still too buggy—and you've got a lean and mean combined-cache serving machine.

Get Professional LAMP: Linux®, Apache, MySQL®, and PHP5 Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.