WordPress Caching Plugins

WordPress Caching Plugins

Tutorial Details
  • Program: WordPress
  • Version: 2.8+
  • Difficulty: Medium
  • Estimated Completion Time: 15 minutes

It is important to have a fast website in terms of both user experience and search results. In this article we will find out what caching is, how it can help to speed things up and two popular caching plugins for WordPress.


What Is Caching?

Caching is a kind of storing data for future uses. We are talking about caching data related to web sites, so these can be HTML, JS and CSS code, but images, fonts, and Flash files are also cacheable.

There are two reasons why we should use caching: to reduce latency (gain speed) and to reduce network traffic (amount of data loaded).

The speed of the website can be a critical factor for commercial websites like webshops or search engines like Google.

Cache is generally used both on the client side (browser) and on the server side.

On the web usually every content component has an expiration date and time, that dictates how long the application uses the old version. When this time expires the server and client will use a new version which has to be downloaded again.


Caching Strategy Tip

Statistics1, pic by Peter Forret, flickr

A good strategy for caching is to identify the most popular and / or largest sized data and apply caching to that first. After this you can go further and find more components to cache.


Disabling Browser Cache in HTML

With this code placed in the top of the head section you can turn off client side caching.

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Disabling Server Side Cache in PHP

This little two liner code goes to the uppermost part of a PHP file.

<?php
	header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
	header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

Using a CDN

Statistics2, pic by mackarus, flickr

CDN stands for Content Delivery Network. Usually it consists of multiple servers in multiple geographical locations to handle content used by websites. It can be used to speed up the loading of external files like CSS, JS and images. There are both free and paid options if you want to use this kind of service.

The physical location of the CDN servers is very important. If your website is in Europe and the CDN you are using has only servers in Europe but an American user requests a page then it will be just as slow as if you didn’t use CDN.

Two popular free CDNs are Cloudflare and Coral. On the paid side Amazon Cloudfront is probably the biggest and most well known service, which has an on-demand pricing and a traffic calculator.


What Will Be Cached?

It depends on your plugin what will be cached. Some plugins offer only caching for back end (PHP, MySQL) and others can handle frontend as well (HTML, CSS, JS, images, fonts, etc.). Read the description of the plugin to learn which parts of the
webpage will be handled.


Static and Dynamic Content

Static content (front end) is usually regular files (CSS, JS, images, Flash files, fonts, etc.) on the server and handled using the simplest methods available to the web server. Dynamic content (back end) is always generated (generally from a database, eg. articles in the case of a blog) at the time of request to the page.


Web Server Support of Caching Components

If we talk about Apache, there are two methods which can handle HTTP based caching: one is mod_cache and the other one is mode_file_cache.

You can also find the Apache guide useful to understand how it handles caching and requests as well.


Why Use These Two Plugins?

These two tools were downloaded more than 4 million times combined and have a healthy reputation as well. While WP Super Cache is a simpler plugin in terms of how many things you can set, the other one is like a monster, because it has got a couple of dozen features per category.


WP Super Cache

WP Super Cache

The description: “Very fast caching plugin for WordPress.”

This plugin basically works as a page cache which means that it creates static HTML files. These files are stored and replaced again when the given time expires. WP Super Cache is based upon a plugin originally by Ricardo Galli Granada. The usage of the plugin is very simple: install, then go to the options page and set the desired cache time. It is important to know that dynamic content eg. within the sidebar, will be refreshed only when the cached pages are refreshed.


W3 Total Cache

W3 Total Cache

The description: “The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.”

This tool has a broad range of settings for example: page caching, minifying, database cache, object cache, browser cache, CDN, Varnish, performance and security by Cloudflare. It even features debug mode for several settings and the user can export and import configuration files.

Several benefits of using this plugin according to the developers:

  • improved search engine ranking
  • increased visitor time on site
  • optimized progressive render
  • fewer HTTP transactions
  • reduced document load time
  • bandwidth savings

Comparison

WP Super CacheW3 Total Cache
FreewareYesYes
Plugin Version1.10.9.2.4
WordPress Version3.0+2.8+
Downloads3.4 million+1.2 million+
Average Rating44.5
Works Without Modifying FilesYesYes
CDN SupportYesYes
Page CacheYesYes
Tested Server Support
  • Apache
  • Apache 1.3+
  • Nginx 0.7+
  • IIS 5+
  • Litespeed 4.0.2+
Plugin Homepageby Donncha O Caoimhby W3 Edge
Support ForumWP Super CacheW3 Total Cache
FAQYesYes
Number of SettingsModerateVery Many
Number of DevelopersOneSeveral

Which Plugin to Choose?

Both plugins offer several usable categories of caching. The user interface of W3 Total Cache looks nicer than WP Super Cache, but at the same time the options can be a bit overwhelming there. It is a good idea to install both tools, check all the options and decide what you need, but all in all I would stick to WP Super Cache to spend less time fiddling.

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.guideplease.com Dilawer Pirzada

    I shall prefer W3 Total Cache, Because it gives up to 80% Bandwidth savings via Minify and HTTP compression of HTML, CSS, JavaScript and RSS feeds, improves web server performance and content delivery network (CDN) integration with Media Library, theme files and WordPress itself.

    I mostly prefer to others to use this plugin.

  • Pingback: WordPress Caching Plugins | Qtiva

  • Barış Ünver

    Great article!

    I’ve used WP Super Cache for a very long time (I’ve also contributed to the plugin by translating it into Turkish) but after I had some server issues with my hosting provider, I switched to W3 Total Cache. It seemed to me that performance did not differ a lot, but I always like having control over everything I have :) and W3TC offers much more options than WPSC. I’m still using W3TC but then again, I really didn’t feel much difference.

    Long short short; experienced users might try and like W3 Total Cache but I guess everybody can use and like WP Super Cache.

  • http://www.digitaladvices.com/ Vivek Nath.R

    Currently I’m using W3 Total Cache and I’m satisfied with that.

  • http://perilousprojects.com Dr.Peril

    I love W3 Total Cache, but it often behaves strangly for multisite installs, do you have a specific multisite recommendation?

    Thanks,
    ~ Aaron

    • http://www.w3-edge.com/ Frederick Townes

      Among the several reasons for delay with the next release is adding multi site compatibility / functionality to the framework. The next release is a game changer. Hopefully these comparisons to WP Super Cache will end one day.

      • jyaz

        @620f088a0077f7d3f8fdd633a5bb60ee:disqus If you could also make it work with multi network (which is almost the same thing as multisite, so I don’t think it’d be very complicated), that would be amazing. :D

  • http://www.prophotostudio.com.au Peter Rodrick

    Great article! I’ve just started looking at Cloudflare and already run SuperCache. Now going to have a look at W3 Total Cache.

  • http://nathanadams.net Nathan

    What about Quick Cache , how does that compare to Super Cache and W3 Total Cache?

    • http://www.w3-edge.com/ Frederick Townes

      QuickCache does PHP based caching which is a subset of the *page* caching functionality in both WPSC and W3TC. Caching in PHP is *slower* than caching with the web server or reverse proxy or CDN (both of which W3TC supports) directly.

  • Pingback: 2012 Fastest WordPress Hosting Pricing Under $10/mo | Open Knowledge

  • http://www.sanjaykhemlani.com/ sanjay

    Been using W3 total cache to all of my website and clients sites. Haven’t tried WP Super Cache though.

  • http://www.nebulasdesign.com Nebulas Website Design Chelmsford

    We used to use WP Super Cache but found it a bit annoying to have to disable it each time we wanted to make and view and changes, this was also confusing for our clients as they assumed their changes hadn’t been applied. I often forgot to enable it again. Although setting this plugin up is incredibly easy.

    W3 Total Cache is better as it doesn’t cache the website if you are logged into admin so any changes can be seen instantly. It’s also very easy to set up. This is one of the core plugins we install in all of our WP websites and is a must.

    • http://www.w3-edge.com/ Frederick Townes

      If I recall correctly, WPSC also disables the cache for logged in users if you choose to toggle that setting.

  • Pingback: This Week In WordPress: Aug 20, 2012 | Max Foundry

  • http://www.mvestormedia.com/ Ian Rogers

    I definitely prefer W3 Total Cache over all of the other caching plugins. It makes optimizing for WordPress speed super simple. Browser caching combined with a CDN could never be easier to setup without this plugin.

    As for the CDN, I recommend using MaxCDN- they have a free TB of bandwidth (valid for a year) available to sign up through August!

  • http://freakify.com/ Ahmad Awais

    I don’t prefer using a Caching plugin. I am using some hacks which I have to integrate manually in htacess file and header or footer files. They make the site fast, whereas save me from using a third party plugin.

    • http://www.w3-edge.com/ Frederick Townes

      The only problem with the hacks is that they do not optimize for the cache misses, which is territory that W3TC supports exclusively as the only real Web Performance Optimization framework for WordPress. Not only that, but the idea that you can change the caching policy for any aspect of your site, means more control for those who want it.

  • http://wp.envato.com/ Japh Thomson
    Staff

    Thanks so much for stopping by and leaving your comments, Frederick. It really helps to get the perspective of the actual developer. Much appreciated :)

  • Pingback: WordPress Plugin Round-Up, Volume I | Web Hosting Blog at ASO

  • Pingback: WordPress Plugin Round-Up, Volume 1 | HostNine Company Blog

  • http://blogvkp.com/seo-for-bing-tips/ Vivek Kumar

    I really want to use w3total cache. After using it Gtmetrix gives me 92 in. But w3total cache doesn’t works for me. Whenever I install it and disable the preview, it gets reset. Then I again make the changes. Once I click on save setting every thing will go off. I made every possible changes. I even made my htacess file 755, but still doesn’t works for me. I wish in near future I will be able to use this awesome plugin.

  • ivica

    E-commerce/web shop sites usually have problems with the caching plugins – they don’t work properly. I wanted to speed up my site, but no caching plugins worked properly. I was lucky because I found the following plugin which speeds up e-commerce/web shops sites considerably (for mine site – load time was reduced from 10 to 4 sec). The name of the plugin is Performance Optimizer Plugin for WordPress and you can find him on http://codecanyon.net/item/performance-optimizer-plugin-for-wordpress/2413770.
    The best of all is plugin support – guys would fix (for free) whatever possible issue that you have with their plugin. Awesome! :-)
    Enjoy it!

  • http://smashinghub.com smashinghub

    i am using w3 total cache, Although its big complex for configuration, but its has more worthy than wp cache

  • http://www.valpocreative.com Valpo Custom Web Design

    W3 Total Cache wayyy better, all-in-one plugin has absolutely every caching function one could possibly need. Its really is a monster. Goes way above and beyond, the reason it has less downloads is time, super cache has been around longer, but it’s by no means better.

  • http://www.known.pk Raheem Khan

    I am also using w3 total cache a bit difficult to configure but works like a charm ;) Thumbs up

  • http://akhilendra.com/ akhilendra

    I was using W3 cache but it was causing a strange issue. At the time of activating it, everything will look good and remain good for sometime, but after few hours, it will redirect my homepage to rss feed page. So i have deactivate it, will check out super cache.

  • http://ahrengot.com/ Jens Ahrengot Boddum

    W3 is such a great tool. One of the most important plugins I’ve ever come across. I use it on every website I launch, and it’s just fantastic to get those 90+ scores in Google Page speed.

    On top of that, it’s nice to see the plugin developer, Frederick, is still active and that he keeps adding cool features like separate caching for desktop computers and smart phones.

    I’d definitely say that W3 total cache is 95% of the reason the Skive Festival website i built scored 95/100 in Google Page Speed.

  • janw

    I was hoping for a bit more in depth comparison.
    Like actually try both plugins under different circumstances, see which is better in speed/page size and such.

  • http://memeLab.com.au/ Tim Osborn

    I agree with janw – I think its difficult to compare the two without comparing similar configurations on a given website (what a process that would be!). I’ve only used a small subset of W3TC features, and the minify settings have always broken something on my site (knowing how to set it up is a qualification all of its own!). For this reason, I end up using WPSC, and am on the hunt for a friendly minifier to complent…

  • Pingback: How to Speed Up Your WordPress Website | ThematoSoup

  • Pingback: Publishing, Optimizing and Coding: Top WordPress Resources for November 2012 - ManageWP

  • Pingback: Is een trage website slecht voor je SEO? | MARA Communicatie, SEO tekstschrijver

  • http://twitter.com/wmwebdes Keith Davis

    Hi Adam
    I’ve just installed Quick Cache plugin on a few sites.
    It is super easy to set up and appears to speed things up pretty well.

    Is is possible to test how much faster pages are loading?

  • edsbali

    I’ve tried both the plugin and I found a significant difference. W3 Total Cache consume more disk space (almost twice) than WP Super Cache.

  • http://www.sutanaryan.com/ Ryan S

    Using “W3 Total Cache” here yes I agreed lots of settings but if you know what you’re doing your site is sky racket fast.

  • http://www.hubtank.com/ HubTank

    what would be good cache plugins for my site hosted in godaddy ?

  • http://twitter.com/MichaelGKeating MichaelGeorgeKeating

    Thanks for the comparison. I was running W3 Total Cache on my site http://michaelgkeating.com and decided to delete it one day for some reason. Shortly after, I started getting infinite loops for pages I redirected and also newly created pages. I’m not 100% certain that removing the plugin was the cause, but just as an FYI make sure you find proper instructions for removing the plugin to avoid any problems.

  • Pingback: March Income Report – $6,975.30 - Pinch of Yum

  • Pingback: Are These The Best WordPress Plugins? - My IM Journey | My IM Journey

  • Bông Hoa Sen

    Your dish reminds me of summer more exciting scenes. I was very happy to have full friends. Thank you. If you want to know about my country and the dishes, go to: vegetarianviet.blogspot.com.