Last week, Konstantin Kovshenin released Surge, a new page caching plugin for WordPress. It’s main feature is that it has no configuration settings. Zero. Simply install and activate the plugin. That sounded too good to be true, so I installed the plugin and did some quick testing.
This blog is currently hosted on a modest VPS server at Linode. It uses a lightweight WordPress theme and I’ve got NGINX set up to cache pages for 10 seconds using fastcgi_cache (“microcache”). This helps protect the server from traffic surges, but does not intelligently invalidate cache when content is updated. This makes it a poor option for real page caching. Fortunately, Surge works well as a second layer of caching, “behind” microcache.
I’ve previously used Batcache, WP Super Cache and W3 Total cache, and found most of them cumbersome to set up. In stark contrast, Surge is literally as easy as it gets. Install and activate. There isn’t even a settings screen.
To test how effective Surge is in my case, I loaded and refreshed a number of pages on this blog, and noted the “x-cache” headers to see if I hit NGINX’s cache or Surge. For each request, I recorded the TTFB value.
|No cache (ms)||NGINX cache (ms)||Surge cache (ms)|
Unfortunately, I was only able to test from one location, since I needed to manually inspect the request headers to see which cache the page was being returned from. It would appear that the “Time To First Byte” value for pages served from Surge’s cache are incredibly low. As far as I know, NGINX caches in memory, so it’s impressive to see Surge come so close.
These tests are far from scientific, but my first impression is that Surge is very, very fast. And considering how easy it is to use, this is probably going to be my recommened page caching plugin from now on.
Update: Some more tests
As requested by Konstantin in the comments, I ran some HTTP benchmarks using hey. The “no caching” test caused high Linux sysload values, whereas the other tests ran relatively smoothly. Here are the numbers of requests per second my server managed to handle. All requests returned status code 200 (success).
|Test setup||1 min test||5 min test|
|Surge + NGINX microcache||1277||1517|
There’s not a lot of difference between the results for microcache with and without Surge active. But please keep in mind that microcache only caches a page for a few seconds, primarily to deal with traffic spikes. Also, the test requests the same page over and over again. In the wild, traffic will likely be distributed over several pages. Surge’s longer cache time (10 minutes) means more pages will be served from cache in such a scenario.