Important Note

This tutorial assumes you have already created a pull zone.

Installing W3 Total Cache

  1. Log into your WordPress Admin Panel.

  2. On the left-hand sidebar, hover your mouse over “plugins” and click “add new.”

  3. In the search box, type “W3 Total Cache.” Then hit the search button.

  4. You’ll see the W3 Total Cache plugin listed under the “name” column. The description will list the creator as Frederick Townes. This is the plugin that you’ll want to install.

  5. Install the plugin.

  6. A message will pop up asking you if you’re sure you want to install the plugin. Click “OK.”

  7. Once the plugin has been installed, you’ll need to activate it. Just click the “activate plugin” link to do so.

  8. A new menu item called “performance” will appear at the bottom of the left-hand sidebar. Hover over it and select “general settings.”

Configuring W3 Total Cache

  1. Log into your WordPress Admin Panel. Scroll down to the “performance” link on the left-hand sidebar and select “general settings.”
  2. Scroll down to the page cache box. Check the box to enable page caching and then make sure that “Disk: Enhanced” is the selected method.
  3. In the next box down, enable the minify function by checking the box and selecting the “manual” mode.
  4. Database cache should be disabled, so make sure that the “enable” box is not selected.
  5. Check the boxes to enable object and browser caching.
  6. Enable CDN, and then select MaxCDN from the drop-down list.
  7. On the left-hand sidebar, look under “performance” and click on “CDN.” Now you can enter detailed CDN settings.
  8. In the “general” section, you can select which filetypes to host on CDN. To get SEO benefits, check the box for “add canonical header.”
  9. Scroll down to “configuration” section. In the “authorization key” field, you need to input your API details, which consist of your alias, consumer key, and consumer secret.
  10. It will need to be in this format: “alias+consumer_key+consumer_secret.”
    To make things easy, just click the “authorize” button. It will take you to your CDN control panel and retrieve your API details for you.
  11. If you don’t yet have API generated, please follow this instruction page.
  12. Once you’ve entered your authorization key, you can enter your CDN domain into the “replace site’s hostname with” field.
  13. Your CDN domain was created when you made a pull zone. To find it, go to your MaxCDN control panel and click on “manage” for the pull zone you’re working with. Your “CDN URL” will be listed – copy and paste that into the hostname field back in WordPress, and you’re good to go.
  14. Hit the “test MaxCDN” button to make sure everything is in order.
  15. You might be directed to the W3TC plugin page with this error: “A configuration issue prevents CDN from working: You need to select / create a pull zone. Specify it here.” If this happens, just click the provided link called “specify it here” and you’ll be directed back to the “configuration” section in WordPress to select a pull zone from newly provided drop down list.
  16. Once you’ve done that, try clicking on “test MaxCDN” again. It should work this time.
  17. To finish up, click “save all settings.”
  18. Tweaking

    1. To tweak your browser cache, click on “browser cache” under the performance menu heading on the left-hand sidebar.
    2. Under “General” section you have the provided features for browser caching:

      • Set Last-Modified header
      • Set expires header
      • Set cache control header
      • Set entity tag (eTag)
      • Set W3 Total Cache header
      • Enable HTTP (gzip) compression
      • Disable cookies for static files
      • Do not process 404 errors for static objects with WordPress
      • Hit “Save all settings” to finish defining browser cache policy.
    3. If you want to tweak minify, click on “minify” under the performance header on the left-hand sidebar.
    4. At the top of the page, click on the link for “HTML & XML.”
    5. You’ll see the “HTML & XML” section, where you can check the box to enable HTML minify settings.

    6. Now, you’ll be able to choose the settings that you want:

      • Inline CSS minification
      • Inline JS minification
      • Don’t minify feeds
      • Hit “Save all settings” to finish setting minify.
  19. Additional CDN Tweaks

    1. Custom File List (Performance → CDN)
      W3TC may not automatically identify all of the files that you want served by the CDN. To change this, simply add these files or directories to the “Custom File List” text area (one file/directory per line).
      Some files that are commonly ignored are those within your wp-content/uploads directory. To serve these files add this line to the text area: “wp-content/uploads/*” or use directives to locate WP directories (wp-content, uploads, plugins, gallery) as follows:

      • {wp_content_dir}/gallery/*
      • {wp_content_dir}/uploads/avatars/*
      • {plugins_dir}/wordpress-seo/css/xml-sitemap.xsl
      • {plugins_dir}/wp-minify/min*
      • {plugins_dir}.css
      • {plugins_dir}/*./*.js
      • {plugins_dir}/*gif
      • {plugins_dir}/*.jpg
      • {plugins_dir}/*.png
    2. Rejected File List
      There may be certain files that are being served by the CDN that you would like to serve locally. Usually, these files are parts of plugins designed to disregard cross domain load. To change this, simply add these files or directories into the “rejected files” text area (one file/directory per line) and jus as with the “Custom File List” you can use directives to locate WP directories:

      • {uploads_dir}/wpcf7_captcha/*
      • {uploads_dir}/imagerotator.swf
      • {plugins_dir}/wp-fb-autoconnect/facebook-platform/channel.html

Important Notes

  • In some cases, enabling minify for CSS/JS or database caching will result in errors or a broken website. It might be a good idea to disable these two options for the time being.
  • In some cases, Flash-based sliders/carousels break when using W3 Total Cache. If you notice such issues, make sure to add the slider plugin path to the W3 Total Cache “rejected files” box.
  • When using W3TC, your origin URL for the pull zone must always be the main root domain like http://domain.com, even if the website is actually installed in a subfolder like http://domain.com/wordpress/. This is because W3TC will automatically add /wordpress/ at the end of the CDN domain. So if the origin URL contains /wordpress/, then the final W3TC CDN URL would be http://domain.com/wordpress/wordpress/.
  • Using the test button won’t execute a CDN implementation/functionality test, it is only used to test the API connection with MaxCDN. The API is needed for the W3TC Dashboard widget and for remote purges of CDN files.

Find more CDN/caching plugins for WordPress on this page.