W3 Total Cache for WordPress Users

Posted on

Finding the Build Script Hard Work?

The scope of the HTML5 Boilerplate by Paul Irish and the team is pretty big. In fact, they seem self-aware of this, sending a questionnaire to their users, trying to figure out which parts of the project people use or don’t use. Here are the results.

Part of the Boilerplate is a tool called the Build Script; a script that runs in Terminal that essentially speeds up your website through compressing your code and images, forcing visitor’s browsers to cache everything, and probably some other wizardry that I can’t fathom.

Unsurprisingly over 70% of users don’t use the Build Script. Whilst the BS seems great, it’s one weakness is that it requires a bit of time-investment to download Terminal stuff and figure out what’s going on. Sure, the HTML5 team have videos, but as soon as you start watching them it’s immediately clear that Paul and the team are already perfectly comfortable with Terminal and assume we are too. When Paul started typing gibberish like ‘Ant Build’ into the Terminal I imagined many of the designers out there simply switching off. From the outsider point of view it’s more developer territory. Don’t get me wrong, I think the Build Script is great, but there’s an easier way…

The Good News

If you’re in the habit of building websites on WordPress, there is an amazing tool that will pretty much do the same thing as the Build Script, but with a nice user interface and no Terminal work :-). I’m talking about a free plugin called W3 Total Cache, which I’ve seen recommended in many places but not bothered to check out until now. I’m so pleased with it that I’m going to side-park the Build Script from now on (unless I’m working on a non-WordPress website of course).

Video Notes

Don’t forget to empty your cache in the ‘performance’ tab of W3 Total Cache every time you upload a piece of code that W3 Total Cache will compress e.g. if you have CSS compression enabled and you upload a new version of your stylesheet you’ll need to empty the cache before you see the changes to your website.

Here is the link about why you should use the enqueue method to load jQuery and not hardcoding.

Please use the below code for running jQuery from the functions file. Ignore my suggestion in the video, it actually broke the jQuery in my Dashboard afterwards:

function my_init_method() {
  if(!is_admin()) {
      /* This code taken from Digging Into WordPress by Chris Coyier + modified so that jQuery is in the footer, with reference to: http://codex.wordpress.org/Function_Reference/wp_enqueue_script */
    wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/ jquery/1.6.1/jquery.min.js"), false, '1.6.1', true);
add_action('init', 'my_init_method');

Here is the documentation for the enqueue parameters.

2 thoughts on “W3 Total Cache for WordPress Users”

  1. Anonymous says:

    I’ve just stumbled across your site- fantastic. Thanks so much for all the posts and videos. I’m a massive fan of the HTML5BP but the build script made me want to cry. It’s just too difficult as I have never done any terminal work. I don’t work on a local server either (perhaps I should?) so the way it worked was a little alien. The W3 Total Cache looks great and your video really helps. It would be good if you could do a more detailed video later on some of the other settings.

    I was wondering if you could give a bit more info on the Javascript bit. I am very new to WordPress and so I don’t know how it handles Javascript. I got a bit confused with what you were saying and where to put the code above.

    I wanted to implement the best practices from the HTML5BP with the javascript files and I don’t know how to do this in Word Press. I assume I add the modernizr script in the head, but how do I link to JQuery, my plugins file and my scripts file? Any help on this would be much appreciated!

    1. Anonymous says:

      Hey Ian, sorry I’m only just replying, I’ve been on holiday for a bit. I’ve not had chance to do much on my site for a while due to time restrictions :-( but I hope to continue with lots of little tutorials once my life stabilises a bit! I’m open to suggestions if you want a tutorial on something specific. If you’re having trouble with something picky then please feel free to contact me on Google Talk (contact@www.jaygeorge.co.uk)

Leave a Reply

Your email address will not be published. Required fields are marked *