Odin SQL

Programming, software and technology

  • Blog
  • About
  • Contact
You are here: Home / web development / A comparison of WordPress caching options

A comparison of WordPress caching options

January 13, 2015 by Benjamin Knigge 2 Comments

Wordpress logo

WordPress logo

 

I’ve spent the past couple of days bringing my site up and down while comparing the many caching options available to WordPress. This is the synopsis of my research. Hopefully this information can help someone else make a more informed decision about the many caching options available.

If you want to implement any of these you’re going to need to be hosting WordPress on your own VPS unless your hosting company is willing to implement caching for you.

The server that this was tested on is a $10 1 CPU Linode VPS with SSD.  The memory and CPU constraints of a low-cost VPS guided my decision-making process. If I had more RAM available I probably would have used memcached more despite the fact that the performance I’m able to get out of an SSD is great.  The initial installation of Nginx was done using EasyEngine which greatly simplifies the configuration required for WP Super Cache or W3 Total Cache. I’ve outlined getting WordPress up and running using EasyEngine here. I’m not going  into details in how to configure each one of these options I just wanted to outline some the pros and cons of the options that I have implemented.

What is Caching?

If you’re reading this you already know. When a request is made for certain content the response from your web server can be stored for a predetermined amount of time either on disk or in memory.  That storage is referred to as a cache.

Why cache?

Your website will serve dynamically generated pages much more quickly while putting your server under far less load.

Which caching options were compared?

  • WP Super Cache
  • W3 Total Cache
  • WP-FFPC
  • Pagespeed for Nginx
  • Nginx Proxy Cache

WP Super Cache

WP Super Cache is probably the most popular caching plugin for wordpress. I used EasyEngine which generates the the necessary nginx config and stores it at /etc/nginx/common/wpsc.conf I was able to server 15,000 page requests per minute using it and the response times were good.  Nginx is very good at serving up static content quickly with minimal system requirements. The only negative about it is that the settings revert to the default and need to be reset if you disable the cache and then re-enable it which is fairly annoying.

W3 Total Cache

The second most popular cache plugin for WordPress W3 Total Cache. It has a lot of options that allow caching objects and database queries in memcached but if you’re using it to generate static pages those options aren’t extremely useful. If you have a word press site with several thousand posts it’s possible that those options could speed up access to less frequently visited posts but it’s not the case with my blog so I didn’t see any befit from storing objects in memcached. It performed approximately equivalently to WP Super Cache but I would recommend WP Super Cache over W3 Total Cache because of the simplicity and the fact that W3 Total Cache has an incredibly annoying popup nag screen every time you open the setting page.

WP-FFPC

WP-FFPC is another cache plugin for WordPress that can be configured to cache your PHP pages to memcahed which theoretically should be much faster than disk based caching.  Unfortunately the plugin wasn’t playing well with my system and some pages were being cached as completely blank.  It seems that this is an issue that more than one other person in experiencing and I wasn’t able to find a solution to the problem. I also had some concerns about the limited amount of memory available on my VPS. This could be a good solution if you’re on Apache and have a decent amount of available memory but it wasn’t working on Nginx with PHP-FPM for me.

Pagespeed

The pagespeed module is available fo Nginx and Apache caches and optimized the content being server. On Nginx it actually needs to be compiled as part of the server. It analyses the content of the pages and images being served and can make changes to them such as removing comments and white space, minifying and combining js and css, and optimizing images. This all can theoretically reduce the amount of time that it takes to download and render a page.  Pagespeed actually accesses and optimizes not only the page that you are serving but will access and optimize the content of all the included page resources such as js, css and images and can then store the results in either on disk or in memcached.

I had numerous problems with Pagespeed each “fetch” to an included resource is handled in a separate thread which isn’t ideal for a server with only one CPU. Even after the request is cached requests are handled much more slowly than when compared to the static caching options and in addition I was never able to configure Pagespeed to server more that 1000 page requests per minute reliably. I also had an issue with a cached and optimized image being corrupt. I finally gave up on dealing with pagespeed after configuring an Nginx proxy cache in front of it and then discovering that pagespeed sets the headers so that the resulting content won’t be stored in the cache and there’s no simple way to change this behavior in pagespeed.  A lot of the functionality that’s built into page speed is already handled by other WordPress plugins and using plugins and a a static page cache is a much easier option resulting in better response times.  These are my results of a load test with 1000 page requests per minute with pagespeed enabled. These we the best results I managed to get out of pagespeed with several hours of effort.  1/15th the number of simultaneous page quests and 4X the response time.

Nginx Proxy Cache

A proxy cache sits in front of your actual web server and depending on the data being requested will either serve a cached version of the data or pass the request for the data onto another webserver. A proxy cache can exist on the same physical server or on a separate one and can also work as a load-balancer between multiple servers. In order to get this to work in WordPress it required adding a couple of lines of code to the wp-config.php so that the site would stop trying to redirect back to the secure version of its self. The issue and resolution are discussed here.    Implementing this takes a bit more effort and research than a plugin like WP Super Cache but it also performs a bit better and the configuration can be easily updated adding in load balancing or fail over.

After implementing this I was able to handle 20,000 page requests per minute fairly well. Here are the results of the load test.

 

Conclusion

If you’re looking for a caching option that is the simplest to implement while offering great performance WP Super Cache is an excellent option.

WP 3 total Cache has a lot of options that will be of no use for the vast majority of people using it. It’s also sporting an annoying repetitive nagging popup.

WP-FFPC wasn’t playing well with Nginx for me but if you’re on Apache and have enough available memory it could be a good option for you.

Pagespeed actually made everything slower and dramatically decreased the number of simultaneous users that my site could support. It may work well on a dedicated server with many processors but on a low end VPS it’s literally worse than not implementing any caching at all.

Nginx proxy cache offers better performance than any of the WordPress plugins. You can put it in front of Apache or any website if that’s your preference. Fail-over and load-balancing are also both possible with a proxy cache. If at some point I upgrade my $10 Linode VPS to something with more memory I can even configure Nginx to use memcached instead of disk.

Filed Under: web development Tagged With: nginx, Wordpress

Comments

  1. Avatarkingsley says

    October 15, 2015 at 10:04 am

    Hello,

    So which do you recommend? I use wprocket but it seems to have issues with my system. Maybe i will try super cache

    Reply
    • Benjamin KniggeBenjamin Knigge says

      October 15, 2015 at 8:10 pm

      I’m personally using an Nginx Proxy cache in combination with w3 total cache using memcache for object caching and Cloudflare pro in front of all of that.

      If I had more ram I would be using varnish but as I’ve said I’m on a $10 a month VPS and my site is pretty quick.

      Reply

Leave a Reply Cancel reply

Who’s behind Odin SQL

Benjamin KniggeWhen I'm not traveling, writing code or optimizing stored procedures I can often be found working on my blog. Learn More…

Email Newsletter

Sign up to the Odin SQL newsletter and receive the latest posts and custom personalized content.

Recent Posts

  • How I improved my WordPress GTmetrix grade
  • A Vultr walk-through
  • DreamHost coupons and promo codes
  • WPEngine coupons and promo codes
  • GoDaddy vs. HostGator vs. BlueHost vs. DreamHost

Categories

  • Hosting
  • Meta
  • programming
  • Software
  • spam of shame
  • Uncategorized
  • web development
  • wordpress

Featured Post

How I improved my GTmetrix page speed and yslow scores.

How I improved my WordPress GTmetrix grade

I’ve managed to improve my GTmetrix page speed and Ylow grades from the mid 70’s to 98% for Page Speed and 97% for YSlow with a page load time of only 1.18 seconds. Here’s a link to the report (if the link is dead feel free to re-run the test). In this post I’m going to […]

Featured Post

CPU utilization

Linode vs. DigitalOcean vs. Vultr vs. RamNode

Comparing SSD cloud VPS hosting providers can be difficult A virtual cpu core at one hosting provider won’t be equivalent to a virtual cpu core at another host or even another virtual cpu core at the same host depending on the specifications of the underlying hardware and the underlying hardware’s utilization at the time of […]

Featured Post

CloudFlare

Free SSL with CloudFlare, OpenSSL and Nginx on Ubuntu

How to Save up to $750 in SSL fees for free In this post I’m going to show you how to set up your site so that you will have an absolutly free fully SSL secured site that automatically redirects non secure HTTP traffic to your secure HTTPS URL.  A basic SSL certificates commonly cost $45 – $75 per year. […]

Copyright © 2025 — OdinSQL.com