If you’re using the W3 Total Cache plugin to make your WordPress site load faster, you made an excellent choice.
I use it with Cloudflare and MaxCDN (which integrate with W3TC) in conjunction with SiteGround’s hosting who is a WordPress recommended host and was rated #1 in this FB poll, and I have a .6s load time in Pingdom (the most accurate testing tool according to WP Rocket).
Many W3 Total Cache settings are preset (shown in the install tab), but not all. I’ll walk you through the performance tabs then help you setup Cloudflare (free) and MaxCDN ($90/year with my coupon or do a free 30 day trial). I have used the W3 + Cloudflare + MaxCDN + SiteGround combo to make multiple WordPress site load 400% faster – now let’s do yours!
Over 75,000+ people have used this tutorial to optimize their WordPress site. It can fix over 20 items in Pingdom: caching, minify, gzip, bad requests, cache validator, add expires headers, ETag, content delivery network, reduce DNS lookups, cookie-free domains, and plenty more. This tutorial is current with the latest W3 Total Cache version 0.9.5.2 updated Jan. 17, 2017.
Here’s my Pingdom report with W3 Total Cache. My GTmetrix report is pretty good too. Of course if you want a nice report like this you NEED to be on fast servers, minimize plugins and external requests, optimize images, and ideally do everything in my WordPress speed guide.
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.
1. General Settings
Here is how Google 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 Pingdom over GTmetrix and Google Page Speed Insights because it’s more accurate (WP Rocket says so too).
2. Page Cache
Enabling compatibility mode is highly recommended by plugin developer (in the install tab) and even though it may slightly reduce performance, problems are much less likely to exist with your site. He says this “optimizes the interoperability 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.
MaxCDN mirrors your site on multiple data centers around the world which reduces the geographical distance between your server and visitor. Without a CDN, you only have 1 origin server which can be very far away for many people. MaxCDN is specifically good for improving items like reduce HTTP requests, use a content delivery network, reduce DNS lookups, reduce cookie size, cookie-free domains, and other items in Pingdom and other speed testing tools. And yes, you should get better results if you use both Cloudflare and MaxCDN.
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, or do a free trial. Use the steps below or watch my video. MaxCDN also has their own tutorial.
Sign up for your plan…
2. Once signed up, go to your MaxCDN dashboard and go to Zones → Create Pull Zone:
3. Enter your website as the origin server URL, the other two are your site name. Click create.
4. Leave this window open (you will need your CDN URL for step 8).
5. Still in MaxCDN, go to the “Account” tab and go to API → View All → Create Application:
- Name/description should be your sitename
- Application URL and Callback URL should be empty
6. After creating an API, leave that window open too. So now you should have your pull zone info and API info (step 4 and 5) open in 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 (from step 6), then use the test button to make sure MaxCDN is working…
Here’s where you enter your MaxCDN info in the “CDN” tab…
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:
10. Finally, view pull zones in MaxCDN and go to Manage → Settings. Make sure you ‘strip all cookies’ and follow the same settings I use, which were configured by MaxCDN themselves.
If you see “cookie-free domains” in your Pingdom report, you may want to contact MaxCDN’s support to see if they will help you with this – they were able to fix this for me.
Be sure to contact MaxCDN support as they were able to tweak my settings to further improve my performance grade. They have one of the best support teams ever – definitely utilize it.
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 using Yoast (ps. my Yoast tutorial is just as good as this).
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 the rubbish and click continue…
4. Choose ‘free website’ then continue. Cloudflare will provide you with 2 nameservers:
5. 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.
6. Now login to Cloudflare and go to your speed settings. You definitely want to enable auto minify for ALL items and Rocket Loader…
7. 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, there may be an ’empty all caches’ option in the dashboard tab. Then retest your site in Pingdom. It can 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, set page rules in Cloudflare, then install the WordPress Heartbeat Control plugin. Deactivate all plugins then activate them 1 by 1 to see which one slows down your dashboard (see complete tutorial).
Slower load times than before – disable “object cache” or wait 72 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. SiteGround Hosting
The word ‘server’ is literally mentioned 70 times in the WordPress optimization guide and 35 times in GTmetrix’s why is my page slow tutorial (news flash… it’s kind of important). Run your site through Google Page Speed Insights to see if reduce server response time is in your report. If it’s not under 200ms like Google recommends it means your server (hosting) is slow.
Another indication is if your time to first byte is high in the “Timings” tab of GTmetrix…
Now check this poll to see where your current host ranks (see full screenshot). This was taken by the WordPress Hosting Facebook Group and over 200 people voted. SiteGround was rated #1 and is the only host listed on all 3 WordPress, Joomla, and Drupal official hosting pages…
Other people like them too…
People who migrated to SiteGround…
I know most of these are affiliates but you still don’t see this with most hosts…
SiteGround has 3 plans…
Higher plans include more server resources (number of servers is the #1 factor in the WordPress optimization guide). You can see a full comparison chart of their StartUp vs. GrowBig vs. GoGeek plan, but GrowBig gives you about 2x server resources as StartUp, and GoGeek is semi-dedicated hosting which gives you even more server resources. GrowBig + GoGeek come with priority support and you can host unlimited sites. Cloud hosting is quite the price jump at $80/year but comes with 2CPU + 4GB RAM and is even faster than GoGeek.
You can see this on the features page…
Their speed technology is the main reason people choose them (NGINX servers, solid states drives, HTTP/2, PHP7, HHVM and 1-click Cloudflare activation in the cPanel with the option to use aggressive caching, minify, and Railgun). Combine SiteGround + Cloudflare + WP Rocket and I will literally PayPal you $50 if your scores/load time don’t improve. Their uptime technology is just as good and I have 100% uptimes in Uptime Robot. You also get WordPress-related support that answers tickets in about 10 minutes average, automatic daily backups, free Let’s Encrypt SSL for eCommerce, and other WordPress features. SiteGround will even migrate ALL your websites/email for free if you’re on cPanel, and 1 website if not on cPanel.
Average load time on SiteGround is 1.3s…
Almost 3 years for me…
Affiliate Disclaimer – if you purchase a SiteGround plan through my affiliate link a portion of it will be donated to a GoFundMe campaign at no expense to you. I am donating $3,000 of my affiliate income at the end of this year (2017) to a good cause that will go to cancer, veterans, something along those lines. My dad survived esophageal cancer so I am just trying to give back and your support would help – and if you’ve read my tutorials you know I also write genuine reviews. If you don’t want to use it here’s a non-affiliate link to SiteGround. Either way I truly believe they are the best WordPress host and that your site will run faster/smoother… do your research on Google and Facebook Groups and you will find most people say the same.
13. More Speed Optimizations
Serve Scaled Images – resize large images to be smaller. Pingdom tells you which images need this but only for the single page you run it through. Start with images that appear on multiple pages (logo, sidebar, footer images) since fixing these reduces load times for multiple pages. Pingdom tells you the correct dimensions of each image, but it’s a good idea to have a cheat sheet of your slider, widget, and other areas so you can resize your images before uploading.
Optimize Images (Lossless Compression) – Imagify is best for this. Sign up and grab an API key, then install their plugin where you can enter the API. Then go to Media → Bulk Optimization and start losslessly compressing all images on your site. There is a free monthly quota of 25MB per month (or $4.95 for 1GB) but it’s much better than other free plugins. From my experience you need to use the “aggressive” setting to fix these items in Pingdom.
Specify Image Dimensions – means you need to specify a width/height in the image’s HTML or CSS. You will need to locate the image (using Pingdom), find it on your WordPress site, then add a width/height which Pingdom will tell you. Usually for images outside your visual editor.
AMP Pages – stands for accelerated mobile pages, is a project by Google, and adds a nice “AMP” stamp to your mobile search results. I provided instructions below…
- Install the AMP Plugin by Automattic
- Install the Glue For Yoast SEO AMP Plugin if using Yoast
- Add /amp/ to any page on your website to see how it looks and make sure it works
- Go to Yoast’s Settings → AMP to change your design and enable custom post types
- Wait for Google to recrawl your site and add the AMP sign in mobile search results
- Visit the “Accelerated Mobile Pages” section in Google Search Console to see errors
Light Youtube Embeds – videos are one of the heaviest elements on a page. Using a thumbnail image (then only playing the video when someone clicks on it) can reduce load times by multiple seconds. I used this tutorial for my site or you can use the WP YouTube Lyte plugin. By the way… have you seen this Ted Talk by Amy Cuddy on body language? It’s pretty awesome.
14. Hire My WordPress Speed Optimizer
Pronaya is a WordPress developer I found on freelancer.com who lives in Bangladesh and specializes in WordPress speed optimization (yes, he’s better than me). I have worked with him for over 5 years and he’s the one who helped me optimize my site to load so fast and multiple client sites to load 500% faster. He’s $25/hour (projects usually run $150 – $300) and he has a perfect 5 star review on his freelancer profile. I have worked with over 20 overseas freelancers and he’s the one I always turn to for advanced WordPress speed and development.
How to hire Pronaya – sign up for a Freelancer account and search for user BDkamol. Make sure the “online users” option is turned off, or email him at [email protected] Serious inquiries only, and please do not tell him you expect a 100% score when you’re using slow hosting, bloated WordPress theme, and tons of plugins. Please review my WordPress speed guide and make sure you’re on good hosting and minimize plugins at the least (thank you!!!).
Reviews of Pronaya…
See Also: WordPress Speed Optimization Guide (20+ Ways To Make Your Site Load Faster)
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 give it a share. I would appreciate that!