How to Install & Setup W3 Total Cache

It is the most complex to setup W3 Total Cache plugin than any other caching plugins in WordPress. Here I will show you how to setup W3 Total Cache properly in your website.

W3 Total Cache is most complete WordPress optimization plugin. It provides page, browser, object and database cache with disk, enhanced disk, opcode, memcache and redis caching methods so this plugins is compatible with all types of hosting. Disk and enhanced disk caching is recommended for shared server, similarly opcode, memcached and redis cache is only available for high performance dedicated/virtual and multiple servers. With advanced caching methods it also supports js, css and html minification, provides transparent content delivery network (CDN ) integration and haves extensions for Yoast SEO plugin, Cloudflare, AMP that makes it the most complete caching plugin.

w3-total-cache
W3 Total Cache

In this article, I will show you how to install W3 Total Cache and configure it to get optimum performance on shared hosting, so we are not going to use Opcode, Memcached or Redis caching methods. Before you begin check performance of your site using Google Page Speed and GT Metrix so that you can compare before and after comparison.

Installing W3 Total Cache

Before installing W3 Total Cache you have to completely uninstall and delete all other caching plugins other wise it may create errors upon activation.

Now lets start, go to your WordPress admin panel and click on Plugins » Add New. Search for “W3 Total Cache” and you will see the result, click on Install Now button and then click on Activate. Then you will be redirected to Installed Plugins page.

Ideal Settings for W3 Total Cache

Configuring W3 Total Cache will be tricky because it is the most powerful caching plugin with tons of options. Your site may become slower if configured in a wrong way. If configured in a correct way this plugin can do all the works in caching field.

Dashboard

This is basic dashboard page and don’t contains any settings. You can only clear cache and do a compatibility check in the dashboard. If you want you can run a compatibility check.

General Settings

  1. Toggle all caching types on or off (at once):
    • Do nothing here, we are going through each settings and enable only those we need.
  2. Preview mode:
    • This option lets you preview your site with new settings before deploying it to live environment.
    • Enable Preview mode to become safe from crashing your site due to wrong settings.
    • Remember to Deploy the settings after you are done all the settings.
  3. Page Cache:
    • It creates static html file of visited pages so that it can be served immediately to the browser.
    • Check on the check-box to enable page cache.
    • In page cache method select Disk: Enhanced.
  4. Minify:
    • Check on the check-box to enable.
    • Select Auto in Minify mode (recommended).
    • In some case auto minification may break your js or css. If it happens to you please try with manual mode. We are going to turn off Rewrite URL Structure so there is more chance to work with auto minification.
    • Select Cache method: Disk
    • Select HTML JS and CSS minifier to Default.
  5. Opcode Cache:
    • It may or may not be available in your shared server.
    • If available turn it on.
    • Select available caching method, Zend Opcache or APC/APCu
  6. Database Cache:
    • It is complicated setting. It may increase or decrease your site performance depending upon your server. It may take more time to get data from your hard disk thus may decrease your site speed. Here we are going to enable it also, you may check disabling it later to check if it increase or decrease your site load speed.
    • Enable it and select Disk in cache method.
  7. Object Cache:
    • Enable it and select Disk in cache method.
  8. Browser Cache:
    • Enable it and select Disk in cache method.
  9. CDN:
    • Enable this if you have using CDN.
    • Do nothing after that.
  10. Enable or Disable Google Page Speed dashboard widget as your wish. If you don’t know about this just disable it.
  11. Click on Save all settings to save.

Page Cache

  1. General:
    • Enable Cache front page.
    • Enable Cache feeds: site, categories, tags, comments.
    • Enable Cache SSL (https) requests, if you are using SSL (https).
    • Enable Don’t cache pages for logged in users.
  2. Aliases:
    • Do nothing here.
  3. Cache Preload:
    • Enable Automatically prime the page cache.
    • Enter your Sitemap URL if you have any.
    • Enable Preload the post cache upon publish events.
  4. After that do nothing  and click on Save all settings to save them.

Minify

  1. General:
    • Disable Rewrite URL structure (if not disabled then auto minification may not work on some browser)
  2. HTML & XML:
    • HTML minify settings:
      1. Check on the check-box of Enable.
  3. JS:
    • Check on the check-box to Enable and select Minify.
    • Before </head>:
      1. Select Non-blocking using “async”. (it improves Google Page Speed Score by eliminating render blocking JS. If you are using CloudFlare, you can also use Rocket Loader with automatic mode instead of this.)
    • Let other options in default value.
  4. CSS:
    • Check on Enable check-box.
  5. Leave all other settings in default value and save all settings.

Database Cache

  1. General:
    • Enable Don’t cache queries for logged in users.
  2. Leave all other settings as is and save all settings.

Object Cache

  1. Do nothing, just leave it.

Browser Cache

  1. General:
    • Check the following check-boxes:
      1. Set Last-Modified header
      2. Set expires header
      3. Set cache control header
      4. Set entity tag (ETag)
      5. Set W3 Total Cache header
      6. Enable HTTP (gzip) compression
    • Leave other setting in default value.
  2. CSS & JS
    • Check the following check-boxes:
      1. Set Last-Modified header
      2. Set expires header
      3. Set cache control header
      4. Set entity tag (ETag)
      5. Set W3 Total Cache header
      6. Enable HTTP (gzip) compression &
      7. Disable cookies for static files.
  3. HTML & XML
    • Check the following check-boxes:
      1. Set Last-Modified header
      2. Set expires header
      3. Set cache control header
      4. Set entity tag (ETag)
      5. Set W3 Total Cache header
      6. Enable HTTP (gzip) compression
  4. Media & Other Files
    • Check the following check-boxes:
      1. Set Last-Modified header
      2. Set expires header
      3. Set cache control header
      4. Set entity tag (ETag)
      5. Set W3 Total Cache header
      6. Enable HTTP (gzip) compression
      7. Disable cookies for static files
  5. Save all settings.

User Agent Groups

  1. Leave it.

Referrer Group

  1. Leave it.

CDN

  1. If you are using CDN you can use this setting to maintain which file to serve from CDN. You can ask your CDN provider to configure CDN setup.

Extensions

  1. W3 Total Cache provides extensions to integrate with different plugins, themes and 3rd party service provider like CloudFlare.
  2. It provides following extensions:
    • AMP
    • CloudFlare
    • Google FeedBurner
    • Fragment Cache
    • Genesis Framework by StudioPress
    • New Relic
    • Yoast SEO &
    • WPML
  3. Activate the extensions you are using them.

Now again run page speed test, and overall performance using Google Page Speed and GT Metrix.

Don’t forget to comment your result.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.