12.7. Choosing Your Caching Engine

So which caching solution is right for you? Perhaps it's best for you to first evaluate the needs of your system, and look for any places that are currently or will soon be a bottleneck. If you're struggling with heavy classes and objects zinging around your scripts, or frequently pull a large amount of repetitive data from your database, memcached will be your best bet for some performance improvements. If your website code generates relatively static pages—you're not using excessive user personalization or other highly dynamic elements—you should consider using JPCache. If the data layer is not really your bottleneck, but your PHP code could use some general performance tweaks, one of the opcode caching engines will help you out. If you're unsure which optimizer/cache to use, a safe bet would be APC. What it may lack in the low-level engine boost or optimization that Zend Optimizer may deliver, it makes up for by being highly customizable, and well-supported—it is after all, part of the PECL repository.

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.