Adventures in WP Caching

Summary

For my very simple site, the big three caching plugins (Hyper cache, Total cache, and Super cache) accomplished nothing noticeable.
A simple custom cacher that just used htaccess to redirect page to a static Html file dropped load time from 850ms to 650ms.
The Comet Cache plugin dropped load lime from 850ms to 350ms.

TL;DR

I, like most of us, wanted to use the ‘best’ caching on my website. My first try was to try the big three – Total Cache, Hyper Cache and Super Cache. each of these seemed to have its own adherents, and the best advice seemed to be that each situation was unique, and it was impossible to tell which was the ‘best’ without trying them. Very frustrating!

So, I tried each of them on my site, using pingdom to measure load times.  For none of them could I detect any significant speedup! Sometimes the caching seemed to speed load times slightly, but the times varied considerably, and it was not uncommon for cached times to be slower than uncached times.

So whats going on? My guess is that it has to do with the simplicity of my site – these caches must work for some sites. My site is abnormal in that it is extremely minimalistic. There is almost no content. The theme is very simple, with no bells or whistles. In addition I have disabled much useless WP functionality such as emoji support, embedding support and other things. The result is a site that loads in about 850ms with very little potential for speedup, and the loading and execution of the caching code masks what little waste they can find.

I took a look at the waterfall provided  by pingdom and noticed that the very first request had a wait time of about 360ms, which I assume is the time my host takes to load and run WP itself. All the other info in the waterfall seemed incomprehensible or inaccessible to my efforts. Most of my content was very slow-changing, so perhaps I could serve it statically, and never even load WP. Use htaccess to redirect to a static copy of the page.

I wrote a very simple plugin called Myt Cache (5Kb!) to do just that. The initial wait time dropped to about 40 ms. and the overall load time to about 600 ms. Success! I then did some tests of this cacher against , and with, some other caching plugins, The big three, as mentioned, provided nothing. Easy cache failed to actually serve the page, though it was very fast:-)

My final try was Comet Cache. Used with Myt Cache it performed like Myt Cache alone, but used alone, the load times dropped to around 330ms!!! I should go on with the exclamation marks. A look at the waterfall showed that the initial wait time was lowered to about 45ms just like Myt Cache, but numerous other things(which I don’t understand) were also faster.

Too soon to tell if these results hold up for a larger site,  but for now I have found my caching plugin!

Adventures in WP Caching Read More »