I’ve previously shared a tutorial on using the W3TC plugin with UPYUN cloud storage to set up full-site CDN acceleration for WordPress. Today, I’d like to introduce another method for speeding up WordPress, which also requires a plugin.
What is eAccelerator?
This method uses eAccelerator to speed up WordPress. eAccelerator is a free, open-source PHP accelerator, optimizer, compiler, and dynamic caching project. It improves PHP script performance by caching compiled PHP code, thoroughly solving the traditionally complex PHP compilation overhead. By using eAccelerator, you can optimize PHP code execution speed and reduce server load. PHP application execution speed can be improved by up to 10x.
How eAccelerator Works
eAccelerator works by caching compiled PHP code in shared memory and serving it directly when users visit, achieving highly efficient acceleration. It is remarkably efficient — from creating shared memory to locating compiled code, everything happens in an extremely short time. For files and code that cannot be cached in shared memory, eAccelerator can also cache them on the system disk.
eAccelerator also supports PHP code compilation and interpreted execution. You can compile PHP code using the encoder.php script to protect your source code. Compiled code can only run in environments with eAccelerator installed. Unlike some other compilation tools that can be decompiled, eAccelerator’s compiled code cannot be reverse-engineered, making your code more secure and efficient.
How to Use eAccelerator with WordPress
The eAccelerator website (https://eaccelerator.net/) has very detailed installation and usage documentation. Let me briefly summarize:
- First, your WordPress version needs to be 2.0 or above
- Upload the
object-cache.phpfile from eAccelerator’s WP plugin to theWP-contentdirectory - If your server runs Windows, you’ll need to restart IIS
Beyond script caching, eAccelerator supports WordPress memory caching — you just need to install the eAccelerator-Based Caching Extension.
It’s worth noting that when it comes to data caching, eAccelerator doesn’t perform as well as Memcached.