W3 Total Cache installs a humongeous “Performance” menu. I’m going to walk my way through the menus and settings, letting you know what I set and what I learned.

General Settings

First off, W3TC includes a preview mode which is a very nice addition. Some (many) of these options have the capability of borking your site, so enable preview mode and get used to this workflow: save all settings->preview->deploy

I’d suggest not checking the box to turn everything on right away. Instead, go through the options one by one turning them on, saving, previewing, deploying. That way if something on your site breaks, you know what you did to break it.

For all of my cache methods, I’m using Opcode: XCache and I’ve enabled just about all of the sections available. The plugin folks recommend using an opcode cache to keep things ready and in memory. XCache happens to be enabled easily with DreamHost VPS, so that’s what I went with.

The plugin warns, in the Install tab, against using Disk Caching for Database and Object caching because it may be too slow.

I haven’t investigated Varnish, so I’m not using that.

At this time, I prefer to keep my DNS hosted at DreamHost, so I’m not using CloudFlare.

Page Cache tab

Cache everything! Mostly… I do not cache my 404 page because it warns about a 200 status code being returned. Which would be incorrect and I don’t cache for logged in users. I believe I’ve left the other settings at default

Minify tab

I’d recommend working slowly through this tab. For instance, on this site, I’ve already done some minification of my javascript and I needed it to be included in a specific order. W3TC destroyed that order and broke my site. As such, I’ve left minification of Javascript off, but opted to minify HTML and CSS. YMMV

Database Cache tab & Object Cache tab

Default settings were fine for me.

Browser Cache tab

In this tab, I’ve turned on just every checkbox except the “Prevent caching of objects after settings change.” Which I may turn on as well… If you have a lot of repeat visitors, this tab will be important to optimize well.

User Agent Groups tab and Referrer Groups tab

These two tabs allow you to filter incoming requests by either user agent (browser & computer) and/or referrer (such as Google or Facebook) and then feed them a different WordPress theme. It happens to be a very convenient way to build a mobile-specific version of your website.

CDN tab

A Content Delivery Network allows you to host static elements on a different server that’s optimized to server static elements. This does a few things:

  1. Allows for browser pipelining. When your browser requests your page it can only open so many concurrent connections (requests) for various elements from your domain. But there’s nothing stopping it from opening a second set of concurrent connections from a different domain (i.e. your CDN)
  2. The CDN is lean and mean. A proper CDN is set up without the capability of serving PHP files. It’s lean and mean and optimized to serve static content.
  3. It may be distributed
  4. A really awesome CDN will have your files in different places around the world country or world so that when someone in New York requests some files they get there as quick as someone requesting them from Australia

W3TC has built-in support for a whole mess of CDNs including the ability to host your own. However, I used Amazon S3 and have determined that it’s super easy to set-up. Note that a CDN is not free, but the cost should be very low in comparison to your webhost’s cost for increasing your VPS’s memory.

  • Go to http://aws.amazon.com/s3/ and Sign up for an account. Follow through the three or four steps. They’ll send you an email when it’s set-up.
  • You’ll need some access keys, and that email they sent contains a link to get yours.
  • Copy and paste the Access Key ID and Secret Key into W3TC
  • Type something to identify your site on Amazon, then click on “create bucket” and walk through the steps. The bucket will be part of your CDN URL and will identify it in the Amazon Web Service dashboard if you ever go there. I picked “wtds-cdn” (websites that dont suck content delivery network) for mine. It’ll need to be unique and you’ll want it to be obvious what it’s for.
  • For now, ignore the CNAME bit (this allows you to set something like cdn.example.com which would actually map to amazon’s servers, but let’s just get things running first).
  • Test the S3 Upload using the button provided. Hopefully, it’s all good!
  • That will get the CDN set-up, now we need to prime it with content. I selected to have it host my attachments, include files, theme files, and custom files, so mark those checkboxes.

    1. If you’ve had your site running for a while, or you’re a fan of hotlinking to images, you may want to click the “importing attachments into the Media Library” button. This will make sure all your attachments are in the WordPress media library and it will update your URLs as needed. Because of this you may want to backup your database first
    2. At this point, you can use the various upload buttons to upload all your files to the CDN
    3. Test! I had an issue with a few files that weren’t uploaded to the CDN the first time around and were generating 404 errors. I didn’t immediately notice the problem because they were font files, but a 404 error can slow down my site. Using the “Theme file types to upload” box I was able to fix this issue. So, test to make sure all your files are being served a) from the CDN and b) aren’t producing 404 errors.

    Install tab

    There are some recommended rewrite rules to include in various .htaccess files. I believe the plugin will try to include this automatically, but if it doesn’t, be sure to put it in there manually.

    So, what did all this work do for me? See the results

    Leave a comment

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