Many W3 Total Cache settings are preset by the plugin developer (shown in the ‘install’ tab), but not all. I’ll walk you through the performance tabs then help you setup CloudFlare (free) and MaxCDN ($6.75/month) which integrate with W3 Toal Cache and make your site even faster. I have used the W3 + CloudFlare + MaxCDN combo to make sites load 400% faster.
I also have a pre-configured zip file of my recommended W3 Total Cache settings, which you can upload in the ‘General Settings’ tab (however you will still need to visit my CloudFlare and MaxCDN section). Once you’re done, retest your site in GTmetrix and I bet your scores have improved. Finally, it’s a good idea to backup your website beforehand – I use UpdraftPlus.
For my own website I use the W3 + CloudFlare + MaxCDN combo in conjunction with SiteGround WordPress Hosting – who was recently voted the #1 WordPress host in this Facebook poll on the WordPress Hosts Group. This is what my GTmetrix report looks like.
Download The Same W3 Total Cache Settings I Use
Download my recommended W3 Total Cache settings here (you’ll need a Dropbox account). Upload under Performance → General Settings → Import / Export Settings. Check your site to make sure everything is OK (should be). You will still need to configure MaxCDN + CloudFlare.
- General Settings
- Page Cache
- Database Cache
- Object Cache
- Browser Cache
- Fragment Cache
1. General Settings
Here’s my 25% off MaxCDN coupon ($90/year annually), or sign up for a free trial. Then head over to my MaxCDN section. Below is how the Page Speed Insights look in your W3 Total Cache “dashboard” tab once you’ve added an API (instructions provided in W3 Total Cache).
I prefer GTmetrix over Google Page Speed Insights because it’s more detailed and has free monitoring through their website. They also have a GTmetrix WordPress Plugin with the option to run an analysis and schedule reports to show directly in your WordPress admin.
2. Page Cache
Enabling compatibility mode is highly recommended by plugin developer (in the install tab) and even through it may slightly reduce performance, problems are much less likely to exist with your site. He says this “optimizes the interoperablity of caching; the tradeoff is that disk enhanced page cache performance under load tests will be decreased by ~20% at scale.”
3. Minify Settings
The plugin developer says the recommended settings for minify, database, and object cache are preset. You can find this in the install tab. Remember, if you’re using CloudFlare this will take care of minify for you, so just make sure minify is turned off in the General Settings tab.
4. Database Cache
- Leave as is (recommended in install tab)
5. Object Cache
- Leave as is (recommended in install tab)
6. Browser Cache
Leave everything else including ‘expires header lifetime’ which the developer says is preset.
A content delivery network stores your website files on multiple servers around the country/world (as oppose to 1 origin server). This allows visitors to access content from the closest server, potentially shaving seconds off your load time. I’ve had great results with MaxCDN and you can use my 25% off MaxCDN coupon ($90/year), or do a free trial. A content delivery network (CDN) is a recommendation in the YSlow tab of GTmetrix:
How To Setup MaxCDN With W3 Total Cache
1. Sign up for MaxCDN. My 25% off coupon + 2 free months for annual billing = $90/year. Then use the steps below or watch my video tutorial. MaxCDN also has their own tutorial.
2. In MaxCDN go to Zones → Create Pull Zone:
3. Replace OMM with your sitename. Origin server URL is your domain, then click create.
4. Once a pull zone is created, leave this window open – you will need the CDN URL.
5. In your MaxCDN Account tab, go to API → View All → Create Application:
- Name/description should be your sitename
- Application URL and Callback URL should be empty
6. Once you’ve created an API, leave that window open too. So now you should have both your pull zone and API info open in different 2 tabs, which is the info we need for W3 Total Cache:
7. Head over to W3 Total Cache and navigate to the General Settings tab, scroll down and enable MaxCDN (remember when you’re using a CDN, database cache should be disabled):
8. Now go to the CDN tab and use these settings. You’ll need to enter your alias+key+secret and CDN URL (located in MaxCDN), then use the test button to make sure it’s working.
9. Save changes, then go back to MaxCDN and Whitelist your hosting IP (W3 Total Cache should have a notification with that IP address). Copy and paste into MaxCDN’s IP Whitelist:
CDN pointers from the plugin developer (found in Install tab) – if you do not use the Media Library, import your images etc into the default locations. Use the Media Library Import Tool on the “CDN” tab to do this. If you do not have a CDN provider, you can still improve your site’s performance using the “Self-hosted” method. On your own server, create a subdomain and matching DNS Zone record; e.g. static.domain.com and configure FTP options on the “Content Delivery Network” tab. Be sure to FTP upload the appropriate files, using the upload buttons.
8. Fragment Cache
You will need to upgrade to W3 Total Cache Pro to use fragment cache (which can make your site faster), but to be honest I don’t use it… so I can’t say whether it’s worth upgrading. If you do they have recommendations on that page I linked to which helps with fragment cache and making the plugin aware you’re grouping transients. You’ll need have some coding experience.
Cloudflare – activate and see step 10.
Genesis Framework – if you’re using the Genesis Framework you can click the ‘upgrade’ button in W3TC to buy W3 Total Cache Pro for $99/year. This will enable additional speed features like fragment cache and the Genesis Framework extension which can improve site speed. Once purchased, it should say “the plugin is enabled in community mode.” Alternatively, your license key will be sent to you via email which you can enter in the General Settings tab.
WordPress SEO by Yoast – activate if you’re using Yoast.
1. In the W3 Total Cache ‘Extensions’ tab, activate CloudeFlare and click the settings:
Configure these CloudFlare settings:
Caching Levels – I use the aggressive caching level which includes query strings.
Hotlink protection – prevents spammy sites from hosting your images on their site (sucking up your bandwidth) which can cause CPU overages with your hosting company. This was a HUGE problem for me and I suggest monitoring links to your site in Google Search Console to make sure there aren’t a crapload of spammy sites doing this. Hotlink protection prevents this.
2. Now sign up for CloudFlare. You will be prompted to add your website and begin scan…
3. Click ‘continue setup’ then scroll down through all the rubbish and click ‘continue.’ Choose ‘free website’ then continue again. CloudFlare will then provide you with 2 nameservers:
4. Do a Google search for “how to change nameservers on SiteGround” (only search for your host), then follow their instructions. You will likely copy CloudFlare’s nameservers and paste them into a custom nameservers option in your hosting cPanel (screenshot below is for SiteGround). Then go back to CloudFlare and click ‘I’ve added all missing records, continue.’ You can also use whois.net to double check that your nameservers have been changed.
5. Now login to CloudFlare and go to your speed settings:
6. Now go to your page rules settings. There are 3 page rules I recommend creating:
Once you’re done configuring W3 Total Cache, MaxCDN and CloudFlare, purge all caches in W3 Total Cache (below). If you don’t see this option, there may be an ’empty all caches’ option in the dashboard tab. Then retest your site in GTmetrix – it should be much faster. If not, see my Youtube video on image optimization which helps you fix serve scaled images, lossless compression, and specify image dimensions. It can also take up to 72 hours for CloudFlare nameservers to propagate, but you should receive a confirmation email when it’s complete.
11. Common Issues
Website formatting issues – disable the “minify” option in the General Settings tab
Slow WordPress dashboard – disable “object cache” in the General Settings tab
Slower load times than before – disable “object cache” or wait 24 hours for propagation
Crashed website: open wp-config and delete these lines:
/** Enable W3 Total Cache */ define('WP_CACHE', true); // Added by W3 Total Cache
Open .htaccess and remove all lines between and including:
# BEGIN W3TC ... # END W3TC
Then delete: advanced-cache.php, objectcache.php, and db.php from wp-content. Also delete the w3-total-cache folder in wp-content/plugins.
12. More Speed Optimizations
Check out the image optimization section of my video which shows you how to fix serve scaled images, losslessly compress images, and specify image dimensions (all are high priority items in GTmetrix). There’s a few other tips but I covered most of them in this W3 Total Cache tutorial.
13. Hire My WordPress Speed Optimizer
This is the same developer who helped me optimize my site to load in under 1s. You can hire Pronaya on freelancer.com by signing up and searching for user bdkamol ($25/hour). I have paid him more than $20,000 in WordPress development and speed optimization for myself and clients. He’s in Bangladesh so when you search for him, turn the ‘online users’ option off.
Well that’s it! I know it can get a bit technical so if you have any questions just drop me a line in the comments. And if you enjoyed my tutorial, please share. I would appreciate that!