WP Rocket Tutorial Including Cloudflare + MaxCDN Instructions

If you chose WP Rocket to make your WordPress site load faster, you made the best choice… considering it was the #1 rated cache plugin in this Facebook Poll.

I tested WP Rocket against 3 top free cache plugins and while they all do a great job, WP Rocket gave me the best results in Pingdom . Your cache plugin and hosting are 2 main speed factors so it’s definitely worth the $39. Configuring the right WP Rocket settings with Cloudflare + MaxCDN can fix over 20 items in Pingdom and GTmetrix. So let’s do that 🙂

The WP Rocket settings are WAY easier to configure than W3 Total Cache and they update the changelog regularly so you’ll actually get ongoing updates. If you have questions (or want to share your new load time), drop me a comment. WP Rocket also has documentation which I reference throughout the guide. Good luck – remember to benchmark those Pingdom scores!

1. WP Rocket Vs. Other Cache Plugins

Here’s the Facebook Poll where WP Rocket was rated the #1 cache plugin. If you would rather go with the free WP Fastest Cache or W3 Total Cache plugin, follow those links for tutorials.

In my own Pingdom test, WP Rocket gave me the fastest load time. I started measuring load times in Pingdom rather than GTmetrix because it’s more accurate (WP Rocket says so too).

I tested WP Rocket, WP Fastest Cache, and W3 Total Cache… making sure all cache plugin settings were configured optimally. WP Rocket won BUT this with the lazyload feature turned ON. The other cache plugins do not have a lazyload option and when I turned lazyload off in WP Rocket, I got a .5s load time… the exact same as WP Fastest Cache. I didn’t see a huge difference when clicking through my pages – both loaded super quickly. I know Pingdom can show different load times during different tests, but I just wanted to share my own experience.

WP Rocket (.406)
Pingdom Page Speed Test

WP Fastest Cache (.527)
WP Fastest Cache Load Times

W3 Total Cache (.619)
W3 Total Cache Load Times

 

2. Install WP Rocket

Once you purchase WP Rocket you can download it on your account page. Upload it under Plugins → Add New → Upload Plugin. If you’re having issues on Safari see their instructions.

WordPress Plugin Upload

 

3. Video Tutorial

WP Rocket’s settings configuration video is outdated since new versions are released frequently so I would check their getting started pagedocumentationpopular articleschangelog, and of course… read my tutorial. I try to keep it updated with the latest versions.

 

4. Pre-Configured Settings (Zip File)

You can download my pre-configured WP Rocket settings then upload them under Tools → Settings Importer. You will still need to make sure the minify items don’t mess up your layout, turn on image lazy load if you want, use SSL cache if applicable, clean up your database, activate Cloudflare, plus tweak other settings in WP Rocket you want enabled or disabled.

WP Rocket recently switched to .json format which prevents me from sharing my pre-configured settings… I contacted them via Twitter about an alternative (will update soon)!

 

5. Basic

WP-Rocket-Basic-Options

Lazyload – delays loading of images, iframes, and videos until you scroll down the page and they become visible (test to see if you like it or not). This significantly reduces load times and HTTP requests however the ongoing loading can be annoying especially for long content. This can also be done using other free plugins like Lazy Load and Lazy Load For Videos but WP Rocket does a great job. I have it disabled lazyload since I find it annoying.

You can also disable Lazyload on individual pages/posts using the sidebar:

WP Rocket Individual Settings

Mobile Cache – enable caching for mobile devices, but only “create a caching file for mobile visitors” if you are NOT using a plugin to create a mobile site (eg. free version of WP Touch).

User Cache – enable if users are logging into your site to interact with it (eg. bbPress). This gives each user their own cache, otherwise this should be disabled. Learn more.

SSL Cache – enable if using SSL.

Emoji Cache – enable since these slow down your site, though you should probably disable these completely under Settings > Writing > Formatting, then do not convert emoticons.

Embeds – this is a new setting which I believe is similar to Cloudflare’s hotlink prevention(prevents sites from embedding your content on their website) which sucks up bandwidth.

Cache Lifespan – leave as the default (24 hours). If you rarely update your site or have a lot of static content, you can increase this a bit.

 

6. Static Files

WP-Rocket-Static-Files

Minify Files – ideally these should make all “minify” and “combining” items in your Pingdom and GTmetrix report 99 – 100%. Sometimes enabling these can cause issues with your layout (especially CSS and JS) so check a few pages on your site to make sure this doesn’t happen. If it does, find the problematic files and add them to either the exclude CSS or exclude JSS option.

Combine Files – just like minify, enable and test.

Exclude CSS – if for some reason a minification option messes up your site layout, locate the problematic file and add it here. See WP Rocket’s article on resolving issues with minification.

Exclude JS – same thing as previous settings only with JS.

Remove Query Strings – In GTmetix you will often see “remove query strings from static resources” which this should fix.

Render Blocking CSS/JS – enable and test.

Critical Path CSS – your page will start loading without CSS styles which is an item in Google Page Speed Insights. WP Rocket provides instructions for this but you just need to turn off WP Rocket, get your code from this CSS Critical Path Generator, then enter the code in this field.

 

7. CDN

Mirrors your site on multiple servers around the world which reduces the geographical distance it takes your content to reach your visitors. This can shave multiple seconds off your load time especially for visitors who (used to be) far away from your 1 origin server. I use MaxCDN (here’s a 25% off coupon) since they have a great reputation, support, and improved my Pingdom performance grades with the help of their team (definitely reach out to them!). If you’re using another CDN, want tips on using a CDN with an SSL, or for troubleshooting, see WP Rocket’s CDN tutorials. You can use MaxCDN’s tutorial but I tell you exactly what to do…

Step 1: Sign up for MaxCDN using my 25% off coupon ($6.75 for 1st month or $90/year), or do a free trial. I didn’t add more locations or Edge SSL as it gets expensive, but you can if you want.

Step 2: Create a pull zone if you haven’t already (view tutorial).

Step 3: In your pull zone settings go to your pull zone and go to Manage → Settings. Find your CNAME which should look something like this: omm.onlinemedia.netdna-cdn.com

MaxCDN CNAME

Step 4: Paste your CNAME in WP Rocket’s “replace site’s hostname” field (also enable Cloudflare and MaxCDN if you’re using them). Use the SSL and rejected files if needed…

WP-Rocket-CDN

CDN & SSL – if you implement a CDN and your SSL pages have errors, you can eith enable this or follow WP Rocket’s tutorial on excluding your CDN on pages with SSL which suggests fixes.

Rejected Files – ​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” area of WP Rocket (add one filedirectory per line) which you can use directives to locate WP directories.

Example:

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

Step 5: In MaxCDN, go to the “manage cache” tab in your pull zone settings and purge files…

MaxCDN Purge All Files

Step 6: Run your site in GTmetrix and “content delivery network” should be green in YSlow.

CDN GTmetrix YSlow

If you expand items in GTmetrix and see it has to do with your CDN, contact MaxCDN’s support team who should be able to help you fix these. They have outstanding support.

Cookie Free Domains MaxCDN

 

8. Advanced

The advanced options are mainly for excluding cart and checkout pages in eCommerce sites.

WP-Rocket-Advanced-Options

Never Cache (URLs) – if you’re using an eCommerce shopping cart not listed by WP Rocket (see the note they have in this settings), add your cart and checkout pages here. Learn more.

Always Purge (URLs) – let’s say you have a blogroll on your homepage. If you create a new post, you want that homepage blogroll updated immediately by emptying the homepage cache. That’s what this setting does, however WP Rocket automatically clears the cache for your homepage, categories and tags once new content is created… so there is no need for this. But if there are other page’s cache you want cleared when new content is added, add them.

Never Cache (Cookies) – same principal as previous option only based on cookies.

Cache Query Strings – mainly used to cache search result pages and price filtering pages for eCommerce sites.

Never Cache (User Agents) – prevents Googlebot or other user agents from caching pages.

 

9. Database

WP-Rocket-Database-Setting

Post Cleanup – revisions, auto drafts, and trashed posts can be deleted if you don’t use them. Unless you have old versions of posts (or deleted posts) you would like to use, delete them.

Comments Cleanup – spam and trashed comments can be deleted.

Transients Cleanup – stores data that takes a long time to get (like social counts) so the next time you need it, it returns super fast. But sometimes when transients get expired they stay in the database and should be deleted. WP Beginner has a great explanation of transients.

Database Cleanup – when you delete a plugin it can leave unused tables in your WordPress database, which you can delete.

Automatic Cleanup – schedule WP Rocket to cleanup your database. Monthly is fine unless these accumulate quickly (eg. many people work on your site). If you have WP-Optimize or another database cleanup plugin installed, you can delete it since WP Rocket does this for you.

Run Cleanup – run it when you’re done.

 

10. Preload

If you want to learn about preloading, WP Rocket has a simple tutorial. Or if you want to dig deeper here is an advanced tutorial which is about WP Super Cache but the same concepts apply. Preload, in somewhat simple terms, is a refresh when the cached pages are all cleared out and refreshed in one go. I would enable as it improves both site speed and indexing speed.

WP-Rocket-Preload

Sitemap Preloading – extends the benefit of preload to ALL URLs in your sitemap, not just your homepage and the internal links you use on the homepage. This does not use an external bot like the manual/automatic option… even if the end result is the same.

Sitemap Crawl Interval – leave as-is unless your CPU usage is high (shown in your hosting cPanel), in which case you should increase this number. If you don’t know, contact your host.

Sitemaps For Preloading – as long as WP Rocket detected your sitemap in the “sitemap preloading” option, there is no need to add it here.

Preload Bot – set to automatic unless you want to do this manually in the tools tab. Should this cause your site to shut down due to hosting CPU limits, you would disable this.

Here’s what the result of preloading can do for your server load…

CPU Usage

Prefetch DNS Requests – add Google Fonts, Youtube videos, or other scripts/requests from external websites to help browsers anticipate these. This will result in faster load times.

Add these if your site uses a Google font:

  • //fonts.googleapis.com
  • //ajax.googleapis.com

 

11. Cloudflare

You do NOT need the Cloudflare plugin, just sign up for Cloudflare and use these settings. Cloudflare is a free service that improves both your speed and security. You should do this.

WP-Rocket-Cloudflare-Tab

Account Email – same email used in your Cloudflare account.

Global API Key – click your name (top right in your Cloudflare account) and go to manage settings. Scroll down and you will see your global API key, then paste this into WP Rocket.

Cloudflare Global API Key

Domain – yourwebsite.com

Development Mode – use when making a lot of code changes to your site.

Optimal Settings – activates optimal Cloudflare settings: minification, aggressive caching, and deactivates Rocket Loader for better compatibility. Most common issue is with Rocket Loader.

Relative Protocol – sometimes if people download files from your site, there are no contents in them. Leaving this option OFF will prevent this from happening.

Clear Cloudflare Cache – do this when you’re done configuring all WP Rocket settings.

 

12. Varnish

WP-Rocket-Varnish-Cache

Varnish Caching Purge – enable if your hosting uses varnish cache. If you’re on WP Engine or FlyWheel hosting, you will not see the Varnish tab because WP Rocket automatically takes care of this for you. If you are on SiteGround hosting you don’t need to enable this because WP Rocket already clears their cache when the WP Rocket cache is cleared. Learn more.

 

13. Tools

WP-Rocket-Tools

Beta Testing – I don’t do this but you can if you want.

Clear Cache – do this when you’re dong configuring the WP Rocket settings.

Preload Cache – generates a cache for your homepage and all internal links you use on the homepage. I don’t worry about this since I have preload set to “automatic” in the preload tab.

Export Settings – export your settings to use on multiple sites.

Import Settings – import your pre-configured settings here.

Rollback – if you update to a new version of WP Rocket and it causes issues, this will fall back on the previous version.

 

14. FAQs / Documentation

I spent many hours digging through their documentation to make sure this tutorial uses the best WP Rocket settings, but they are extremely helpful if you haven’t checked them out…

WP Rocket Documentation

 

15. $199 Configuration Service

You can pay their team to configure the WP Rocket settings for $199. They guarantee to improve your speed or your money back. I contacted their team to see what this meant and they confirmed they will send you a report in Pingdom. So if you’re having trouble with the settings or just want an expert to optimize the plugin (and yes, they are experts), it’s a nice addition. Just make sure you’re on decent hosting first so you can eliminate that as a problem.

WP Rocket Professional Settings Configuration

 

16. Hosting Recommendation (SiteGround)

SiteGround was the #1 rated host in a Facebook poll taken by the WordPress Hosting Facebook Group. They’re the only host listed on all 3 WordPressJoomla, and Drupal hosting pages as well as the only company recommended by Ivica who runs the WordPress Speed Up Group. Their speed technology is amazing which uses varnish cache (shown in the WP Rocket settings), NGINX, SSD, HTTP/2, PHP7, and HHVM. They will migrate you for free if you’re hosted somewhere else and here is their StartUp vs. GrowBig vs. GoGeek comparison chart.

Best-WordPress-Hosting-2017

This is the #1 factor in the WordPress optimization guide

Hosting Performance

Run your site through Google Page Speed Insights and if reduce server respond time is in your report, it means your server (hosting) is slow. Google recommends a >200ms response time.

Reduce-Server-Response-Time

 

Leave a comment


4c.
5.
4.
1...
.