Today I was in an experimental mood and found yet another small trick that felt worth writing about.
At this point my hosting is fairly crappy (but also damn cheap), a virtual host with 128MB of RAM (and up to 512Mb burst). Even with just a few visitors, the server is very slow. Until now I was using WP-SuperCache plugin that converts dynamic WordPress PHP pages into static HTML and serves them. Unfortunately it cannot figure out on the fly that the cached page is out of date and keeps serving the static one until it expires (static lifetime I setup). This is especially annoying while I edit a post as I do not see the changes immediately.
A much more elegant solution is using a PHP caching extension. The one that felt easiest to use and was free was Alternative PHP Cache.
On Ubuntu the installation took a whole 5 minutes to complete (the longest time was wasted trying to figure out some obscure message about apxs). You need to install the following bunch of packages
After that install APC from the Php-Pear repository:
After it finished building, unless it found out your php.ini by itself, you will have to load the extension manually by adding extension=apc.so. For my system this was done with:
Wasn’t that easy now?