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.
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
- Toggle all caching types on or off (at once):
- Do nothing here, we are going through each settings and enable only those we need.
- 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.
- 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.
- 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.
- 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
- 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.
- Object Cache:
- Enable it and select Disk in cache method.
- Browser Cache:
- Enable it and select Disk in cache method.
- CDN:
- Enable this if you have using CDN.
- Do nothing after that.
- Enable or Disable Google Page Speed dashboard widget as your wish. If you don’t know about this just disable it.
- Click on Save all settings to save.
Page Cache
- 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.
- Aliases:
- Do nothing here.
- Cache Preload:
- Enable Automatically prime the page cache.
- Enter your Sitemap URL if you have any.
- Enable Preload the post cache upon publish events.
- After that do nothing and click on Save all settings to save them.
Minify
- General:
- Disable Rewrite URL structure (if not disabled then auto minification may not work on some browser)
- HTML & XML:
- HTML minify settings:
- Check on the check-box of Enable.
- HTML minify settings:
- JS:
- Check on the check-box to Enable and select Minify.
- Before </head>:
- 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.
- CSS:
- Check on Enable check-box.
- Leave all other settings in default value and save all settings.
Database Cache
- General:
- Enable Don’t cache queries for logged in users.
- Leave all other settings as is and save all settings.
Object Cache
- Do nothing, just leave it.
Browser Cache
- General:
- Check the following check-boxes:
- Set Last-Modified header
- Set expires header
- Set cache control header
- Set entity tag (ETag)
- Set W3 Total Cache header
- Enable HTTP (gzip) compression
- Leave other setting in default value.
- Check the following check-boxes:
- CSS & JS
- Check the following check-boxes:
- 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.
- Check the following check-boxes:
- HTML & XML
- Check the following check-boxes:
- Set Last-Modified header
- Set expires header
- Set cache control header
- Set entity tag (ETag)
- Set W3 Total Cache header
- Enable HTTP (gzip) compression
- Check the following check-boxes:
- Media & Other Files
- Check the following check-boxes:
- 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
- Check the following check-boxes:
- Save all settings.
User Agent Groups
- Leave it.
Referrer Group
- Leave it.
CDN
- 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
- W3 Total Cache provides extensions to integrate with different plugins, themes and 3rd party service provider like CloudFlare.
- It provides following extensions:
- AMP
- CloudFlare
- Google FeedBurner
- Fragment Cache
- Genesis Framework by StudioPress
- New Relic
- Yoast SEO &
- WPML
- 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.