Speed Up WordPress With Quick Cache – A Beginner’s Guide
You have probably read that caching can dramatically speed up page load times and lighten the load on your server by serving up cached html pages instead of constantly accessing your database – and that is true. But which caching plugin to use and what to expect?
We recently implemented caching here at TechLogon and can share our findings and things to watch out for. First, we narrowed the choice to three popular plugins – because we wanted good support and a well established user base in case of problems: W3 Total Cache, WP Super Cache and Quick Cache.
After investigating them all we chose Quick Cache – we will review how we decided, how to use it, potential issues and our overall results. Quick Cache is simple to use, has very few options to configure and does not try to do everything. W3 Total Cache and WP Super Cache can undoubtedly do a more thorough job, in the right hands…
However, if you’re not an experienced webmaster and terms like chmod, .htaccess, minify CSS, GZIP and CDN scare you (if only a little), you’re unlikely to get on well with these plugins – they are so comprehensive that their configuration can be complex and prone to user error.
Quick Cache may not speed up your site quite as much as the others (although you can add other plugins and tweaks to improve further) but it is also less likely to break your site or cause unexpected problems due to misconfiguration.
To sum up – it may not be best for everyone but, for relative beginners and those on shared hosting or VPS servers, we think it provides the best risk/reward ratio.
Using Quick Cache – Install the plugin from within WordPress or download it here. Read the installation notes carefully – especially if you have previously used any other caching plugins as you will need to uninstall them first.
Once installed, browse to the Config Options tab in your WordPress admin panel and set Quick Caching Enabled to On (Enabled) then scroll to the bottom and Save All Changes to start caching your website:
By default, Quick Cache does not serve cached pages to users who are logged in, or users who have left comments recently. Therefore, to test if it is working, you must log out of WordPress first – or, easier still, use a different browser.
Now view the page source of one of your webpages – to access the page source in different browsers:
- IE – right click the page and View Source
- Chrome – right click the page and View Page Source
- Firefox – Tools \ Web Developer \ Page Source
If caching is working you should see a few lines of text at the bottom of the page source confirming when the cached file of the page was built and when it expires. The time taken to serve the cached page (in ms) may be a hundred times quicker than the time taken to build it in the first place – good news for future visitors!
Configuring Options – Quick Cache has few options – in fact it may work fine without any additional changes. However, it is worth checking the options to ensure they best suit your own website – go back into the Config Options tab in your admin panel and expand all the options by clicking the + button at the top right.
Review the descriptions of each option – if in doubt, leave them at the Recommended setting. For many users, the key options to consider changing are:
Cache Expiration Time – the time (in seconds) to keep the cached version of a page. The recommended setting equates to 1 hour i.e. if a visitor comes to a page that was cached less than an hour ago, they will be given the (quick) cached version. After an hour the page is re-cached (which takes longer) for the next visitor but then this newly cached version can be served very quickly to other visitors for the next hour etc.
If your pages are static (e.g. posts in a blog like ours) you could set this time to a day or more for maximum performance gains.
Tip: if increasing this Expiration Time, see question 4 in ‘Other Issues’ at the bottom of this article.
Dynamic Cache Pruning – this determines what happens when you update a post or page. The default setting is that the cached version of this single post/page is deleted so that the next visitor will see a newly cached version – with your updates included.
If your website’s front (home) page includes a summary of your recent posts (as ours does) you probably want to set this value to Single + Front Page to ensure that the front page is also updated – to reflect any changes made when you update a post/page.
No-Cache URI Patterns – this section excludes specific files from being cached. There is a potential RSS feed ‘gotcha’ here because the default list of excluded files does not include an RSS feed entry i.e. your RSS feed will be cached too.
If you have set the Cache Expiration Time to an hour or less then a slightly outdated RSS feed may not be significant. However, if you have set it to a day or more, you probably will not want your RSS feed to be cached (not updated) for so long.
[We found this out the hard way as Feedburner stopped emailing RSS updates to subscribers – because the feed was being cached it didn’t have our latest posts in it…]
To prevent your feed from ever being cached – if your RSS feed is yourdomain.com/feed then just add feed to the bottom of the list of patterns in this section – remember to Save All Changes.
Results Of Using Quick Cache – Although results will obviously vary considerably between sites and servers, it may be useful to see some actual figures. Here is an overview of how much our site performance improved after implementing caching.
We use Pingdom to alert us of server issues but it also provides a useful log of response times. These are just pings, not full page loads, but they do give an indication of how much caching has improved initial response:
Hopefully it is pretty clear when we started to use caching ;-) Ignoring the initial day or two (Nov 12 spent testing different options), analysis of the full week before and full week after installation of caching shows:
- Week before – average of 1031ms
- Week after – average of 542 ms
A saving of almost half a second (50%) in response time is a major improvement and nears the performance of much larger sites using serious dedicated servers (albeit they have more visitors/load).
Page Load Times
The improvement in page load times was immediately obvious without automated testing – if a page has been cached, browsing to it has become almost instant and the only real delays are now caused by external (un-cached) links outside of our control e.g. dynamic social media and Google Translate plugins.
We also tested website speeds before and after at GTmetrix – overall page load times reduced by more than 50%. Your mileage may vary but we were impressed at such improved results, for so little effort.
Other Issues/Queries We Had To Investigate
1. ISSUE. Caching 404 (Page not found) error pages may lead to Soft 404 errors which are bad for search engines, and therefore bad for your site. See our guide to prevent Soft 404 errors in Quick Cache.
2. ISSUE (for some people). Does a new comment on a post regenerate a cached version of that post? No – the person who makes the comment can see it (as cached pages are not served to recent commenters) but other visitors will not see it until the cached version expires. This could become an issue if you set the Expiration Time to a day or week as it could prevent other people from seeing the latest comments.
3. QUERY. Where are the cache files located? – They are stored in /wp-content/cache/ Note: if you have an entry in your robots.txt file to disallow search bots from /wp-content/ and all its subfolders, remove it now so that bots can reach the cached files!
4. QUERY. How much storage space do the cached files take up? It depends on the size of your pages and how many get cached – the longer you set the Cache Expiration Time, the more cache files will be generated. As a rough guide, up to 1000 cached posts could easily take up 150MB+ space on your server.
5. QUERY. Are adverts cached? Dynamic adverts (e.g. from Google and Amazon) are not cached so they will still be served up in real time.
6. QUERY. Can you clear the cache manually? Yes – you will see a new ‘Clear Cache’ button at the top right of your admin panel. The cache is also cleared automatically if you change any of the Config Options to ensure there is no mismatch.
Quick Cache is easy to understand, install and use. It is not as comprehensive as some caching plugins (e.g. no CSS/JS minify or GZIP) but it therefore poses fewer risks and still provides an excellent boost to speed up WordPress.