The Ideal WP Rocket Settings With Cloudflare + CDN Instructions Which Got Me 1.2s GTmetrix Load Times (2020, Latest Version 3.6.1)

Home » Cache Plugins » The Ideal WP Rocket Settings With Cloudflare + CDN Instructions Which Got Me 1.2s GTmetrix Load Times (2020, Latest Version 3.6.1)

These are the same WP Rocket settings I used to get this GTmetrix report.

WP Rocket was rated #1 in numerous Facebook polls because it comes with more speed optimization features than any other cache plugin. That’s why it usually yields better results in GTmetrix, Pingdom, and PageSpeed Insights. It also means you don’t need to install a bunch of extra plugins (Heartbeat Control, plugins for hosting Google Fonts and Analytics locally, etc).

I will show you how to optimize fonts, the difference between CDNs (Cloudflare, RocketCDN, StackPath), configure Cloudflare settings and page rules, optimize third party requests using preload and prefetch, image optimization plugins, WebP images, and how to delete old plugin tables in your database which you can’t do with WP Rocket (we will use WP-Optimize for this).

I tried to make this tutorial as robust (and simple) as possible. But if you still need help configuring the WP Rocket settings, drop a comment with your questions or GTmetrix report.

  1. Dashboard
  2. Cache
  3. File Optimization
  4. Media
  5. Preload
  6. Advanced Rules
  7. Database
  8. CDN
  9. Heartbeat
  10. Add-Ons
  11. Cloudflare
  12. Image Optimization
  13. Tools

If you haven’t bought WP Rocket yet, I would appreciate you using my affiliate link. I also donate a good chunk of my affiliate income to charity. You can get 10% off by going to their Coupons Page, sign up for their email list, and they will send you a code.


1. Dashboard

Leave both options off unless you want to be a beta tester or let WP Rocket collect your data anonymously which results in a (very small) performance decrease. RocketCDN is covered in the CDN section, but you don’t need it if you’re using Cloudflare. You can clear the cache or regenerate critical CSS if you make design/plugin changes but they don’t appear on your site.



2. Cache

These are good cache settings as long as you don’t use a plugin for your mobile website and don’t allow multiple users to login to your site (eg. bbPress). I increased cache lifespan from 10 to 24 so the cache doesn’t have to refresh as often, which saves a little bit on server resources.


Mobile Cache – enables caching for mobile devices. Only enable “separate cache files for mobile devices” if you use a plugin for your mobile website (like the free version of WP Touch).

User Cache – leave disabled unless you have multiple users logging into your website (bbPress for example) where there is user-specific content. It gives each user their own cached version.

Cache Lifespan – a lower number means the cache will refresh more frequently, but it consumes more resources. A cache lifespan with a lower number means it won’t refresh as frequently, but saves resources. Do you care more about your cache building frequently or saving server resources? Since I only publish a couple posts a week, I increased it to 24 hours.


3. File Optimization

All HTML, CSS, and JavaScript settings should be enabled individually while testing your site for visible errors. These are the file optimization settings I use which gave me the best results in GTmetrix, but you should be testing your GTmetrix report to check the impact of each setting.


Minify Files – enables minification of HTML, CSS, and JavaScript. Check your site for visible minification errors after enabling each one. If you see any, view your source code, find the problematic CSS or JavaScript files, and exclude them from being minified. That way, you still get the benefits on minification (just not for that file). Otherwise, they should all be enabled.

Combine Files – just like minify, enable and check your site for errors.

Optimize Google Fonts – this compresses fonts into 1 single file, ensures text remains visible while loading fonts, and preconnects fonts (tells browsers you intend to load Google Fonts). Remember to prefetch/preload fonts in the Preload tab and be minimal with fonts/weights.

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.

Optimize CSS Delivery – your page will start loading without CSS styles which is a depreciated item in PageSpeed Insights. WP Rocket automatically generates this for you. WP Rocket says:

“By enabling these options you may see an improvement in your performance grade on GTmetrix, Pingdom Tools, and Google PageSpeed Insights. Results will vary from site to site. Always remember to test the effect on the speed of your site. “

JavaScript Files – same concept as CSS only with JavaScript files.


4. Media

Most sites should enable everything especially in the lazyload settings. If you use embedded YouTube videos on your site, replacing the YouTube iframe with a preview image can cut load times in half since videos are very heavy. You’ll also still need a plugin to create WebP images.


Lazy Load – delays loading of images, iframes, and videos until you scroll down the page and they become visible. This significantly reduces initial load times and HTTP requests, but constantly loading images as you scroll can be annoying (test it out for yourself). Always lazy load videos and replace iframes with a preview image since embedded videos are very heavy.

Disable Emojis – emojis slow down your site. You can also disable them under Settings → Writing → Formatting, then do not convert emoticons.

Disable WordPress Embeds – similar to Cloudflare’s hotlink prevention, it prevents other sites from embedding your content on their site which sucks up bandwidth and stresses your server.

WebP Caching – enable if you’re using WebP images. If you’re not using WebP images already, you should since they load faster and look nicer than JPEG + PNG. Using WebP also fixes the serve images in next-gen format item in PageSpeed Insights. You will still need a plugin that converts images to WebP. I use WebP Converter For Media plugin but Imagify, ShortPixel, and most image optimization plugins have an option to convert images to WebP (TingPNG does not unfortunately). Finally, check your image files in the source code to make sure they use .webp.


5. Preload

Preloading is done automatically by WP Rocket when you activate it with your XML sitemap. Prefetching and preloading fonts are especially important for optimizing fonts and third party scripts which you can find in the Reduce DNS Lookups section of your GTmetrix YSlow report.


Prefetch DNS Requests – run your site through GTmetrix and look at the Reduce DNS Lookups section in your YSlow report. You will see all third party scripts loading on your site which can be anything from Google Fonts to Google Analytics, Maps, ASense, Tag Manager, YouTube, or even social media platforms if you embed social posts or use social share buttons on your blog.

WordPress External Scripts

Grab all those URLs from your report and paste them into the Prefetch DNS Requests section of WP Rocket. This will help browsers anticipate those external requests and load them faster.

Or use this list of common domains to prefetch as a reference:


Preload Fonts – copy your font files from GTmetrix Waterfall (they have a tab for font files) and paste them in WP Rocket’s preload fonts field. Retest your website and they should load faster.



6. Advanced Rules

Advanced Rules are mainly for eCommerce sites, however WP Rocket is already compatible with most solutions like WooCommerce and BigCommerce. But if you’re having issues with cart widgets, caching, or something related to eCommerce, they have documentation for that.

Otherwise, leave this blank.


Never Cache URLs – if you’re using an eCommerce shopping cart that is not supported by WP Rocket, add your cart and checkout pages here which will exclude these pages from the cache.

Never Cache Cookies – same principle as previous option only based on cookies.

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

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 usually no need for this. But if there are other page’s cache you want cleared when new content is posted, add it.

Cache Query Strings – mainly used to cache search result pages + price filters on eCommerce.


7. Database

Scheduling database cleanups keeps your site and admin fast, just know what you’re deleting!


  • Revisions – old versions of your posts which are saved when you hit “Publish.”
  • Auto Drafts – automatically saved versions of your post if you don’t hit “Publish.”
  • Trashed Posts – posts and drafts you deleted.
  • Spam Comments – comments marked as spam.
  • Trashed Comments – comments marked as trash.
  • Expired Transients – transients that have expired and are still in your database.
  • All Transients – stores data that takes a long time to retrieve (eg. social counts on blogs).
  • Optimize Tables – optimizes database tables to run more efficiently.
  • Automatic Cleanup – how often you want WP Rocket to clean your database.

Delete Unused Plugin Tables (Not With WP Rocket) – one thing WP Rocket doesn’t do is let you go through your individual database tables and delete tables left behind by old plugins that aren’t installed anymore. I recommend installing WP-Optimize and going through your tables every so often, especially if you deleted plugins (plus it shows you the actual size of the tables). The tables that say “not installed” are the ones that were left behind by old, uninstalled plugins.



8. CDN

You should really just use Cloudflare’s free CDN, in which case you would change nameservers and don’t need to do anything in this tab (see the Cloudflare tab instead).

WP Rocket says you shouldn’t use RocketCDN on top of Cloudflare. And since WP Rocket uses StackPath’s data centers for RocketCDN (who only has around 32 data centers), you’re better off on Cloudflare who has 200 data centers and counting. More data centers = faster website.

WP Rocket’s CDN tab is only for setting up CDNs who use CDN URLs (StackPath, KeyCDN, BunnyCDN), it is not for Cloudflare (which requires changing nameservers and using the Cloudflare tab) or RocketCDN (requires signing up through WP Rocket).

That means there is nothing to do in WP Rocket’s CDN settings since CDN URLs don’t work with Cloudflare or RocketCDN (they’re specifically for StackPath, BunnyCDN, KeyCDN, etc).

Here’s the catch.

I’m using both Cloudflare and StackPath. Yeah, I’m going against advice not to use multiple CDNs, but it’s been working great and I’m offloading a ton of bandwidth to StackPath. While I don’t advise this and it’s not recommended by WP Rocket, it works for me. If you want to try this, sign up for StackPath, create a CDN site, then copy/paste your CDN URL into WP Rocket.


Grab your StackPath CDN URL:


Paste the CDN URL into WP Rocket:


Testing CDNs – since Cloudflare is set up differently and requires changing nameservers, the “content delivery network” in GTmetrix YSlow will be red (but will be green for other CDNs).  That doesn’t mean Cloudflare isn’t working; use the Claire Chrome Extension to make sure it is.

Exclude Files From CDN – lets you serve files locally instead of the CDN. Usually, these files come from plugins designed to disregard cross domain load. In most cases, there is no need.


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


9. Heartbeat

Instead of using the Heartbeat Control plugin, WP Rocket has it built-in.

The WordPress Heartbeat API tells you when other users are editing a page/post and shows you real-time plugin notifications. You usually want to disable Heartbeat completely, or at least reduce it, since it consumes resources and contributes to CPU overages (eg. on SiteGround).



10. Add-Ons

If you’re using any of these services, activate it’s add-on.


Google Tracking – fixes the “leverage browser caching” issue for Google Analytics in your GTmetrix report by hosting Google Analytics locally. If it’s still not 100%, use the Flying Analytics plugin. If you’re using Google Analytics, remember to optimize it in the Preload tab.

Facebook Pixel  – enable if using Facebook Pixel to host it locally. If you’re using Facebook Pixel, remember to optimize it in the Preload tab.

Cloudflare – enable if using Cloudflare.

Synchronize Sucuri Cache – enable if using Sucuri. This automatically clears Sucuri’s cache whenever you clear WP Rocket’s cache which helps keep your content synchronized. For the Sucuri Firewall API Key (For Plugin), login to Sucuri here, select your website, go to the API tab, then copy your API Key (For Plugin) and paste in WP Rocket when you expand the Sucuri field.


11. Cloudflare

As mentioned earlier, Cloudflare is the only CDN you need which offloads a ton of bandwidth.


Sign up for Cloudflare and you will come to a page where they assign you 2 nameservers.


Change nameservers in your domain registrar to the one’s Cloudflare gave you.


Add your Cloudflare information to WP Rocket.


Global API Key and Zone ID are found in your Cloudflare dashboard.

Cloudflare Global API Key

  • Global API Key – found in your Cloudflare dashboard.
  • Account Email – same email you used to sign up for Cloudflare.
  • Zone ID – found in your Cloudflare dashboard.
  • Domain – your website’s domain name.
  • 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 Rocket Loader, but I also noticed it turns on email decoding which made my GTmetrix report worse, so I don’t use this (and instead configured Cloudflare in their dashboard).
  • 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 All Cloudflare Cache Files – do this after you’re done configuring WP Rocket.

Configure Cloudflare Settings In The Dashboard – a lot of people have been asking about Cloudflare’s dashboard and how to configure it. Here are the things I recommend you do.

Page Rule 1: Cache Everything And Force HTTPS – cache your website aggressively.



Page Rule 2: Secure The WordPress Admin And Bypass Cache – sets security level of the admin to high and bypasses Cloudflare’s cache in the admin, since you don’t want CDNs (or apps + performance features like Rocket Loader) running inside the admin.*


Page Rule 3: Decrease Bandwidth Of WP Uploads – since the content in your WP Uploads folder does not change frequently, increasing Edge Cache TTL to a month can save on bandwidth, since the WP Uploads folder cache won’t be refreshed as often.*


As I mentioned, Cloudflare won’t fix “content delivery network” in GTmetrix YSlow because of the way it’s set up. Instead, use the Claire Chrome Extension to ensure Cloudflare is working.


12. Image Optimization

WP Rocket recommends Imagify because it’s their plugin.

But even when you select lossless compression, it’s definitely not lossless and neither is ShortPixel. I used both for many months and switched to TinyPNG which I’m very happy with. The only thing about TinyPNG is that it doesn’t support WebP in which case you will need a plugin like WebP Converter For Media. But I find the quality is much better than with Imagify.



13. Tools

Import and export your WP Rocket settings, or rollback to the previous version of WP Rocket.


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.


WP Rocket = #1 Rated Cache Plugin

WP Rocket comes with many features most cache plugins don’t (see below). That means if you were to use other cache plugins, you would need to install about 6 extra plugins to get those features when WP Rocket already has them built-in (more features, yet less plugins on your site). That’s also why WP Rocket yields better results in GTmetrix/Pingdom and is what I use.

WP Rocket incorporates:

  • Database cleanup (built-in to WP Rocket, or use WP-Optimize)
  • Heartbeat control (built-in to WP Rocket, or use Heartbeat Control)
  • Lazy load images/videos (built-in to WP Rocket, or use WP YouTube Lyte)
  • Host Google Analytics locally (built-in to WP Rocket, or use CAOS For Analytics)
  • Host Google Fonts locally (built-in to WP Rocket, or use CAOS For Fonts)
  • Integration with Cloudflare + other CDNs (built-in to WP Rocket, or use CDN Enabler)

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 (.4s load times). Your cache plugin and hosting are 2 main speed factors so it’s definitely worth the $49. Configuring the right WP Rocket settings with Cloudflare + StackPath 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!

Here are the Facebook polls:

2016 best cache plugin poll

2019 cache plugin poll

Swift vs WP Rocket

2016 cache plugin poll

Best cache plugins 2018 poll

wp rocket vs w3 totla cache

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 lazy load feature turned ON. The other cache plugins do not have a lazy load option and when I turned lazy load 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


Recommended Host: Cloudways

In case you were wondering what hosting I use, it’s Cloudways DigitalOcean.


Join the WordPress Hosting FB Group to see what real, unbiased people are saying. Look at Facebook polls and tweets of people who migrated and posted their server response times.

I signed up for 15+ different hosting plans and tested them with the identical website:

DigitalOcean On had the fastest load times, is who I use, and are very popular in Facebook Groups (especially as a SiteGround alternative). Cloudways does monthly pricing starting at $10/month with no high renewal prices or strict CPU limits like SiteGround. Their stack is very fast: PHP 7.4, Maria DB 10.3, Memcached, Varnish, Nginx, and Redis. Only complaint is their email hosting costs $1/month (you will need a Rackspace account). Their community manager is helpful and they do free migrations. Get 25% off your first 2 months with the code OMM25. has similar speeds as DigitalOcean on Cloudways only they are more expensive starting at $30/month. Known for being capable of handling many concurrent visitors. People consistently recommend Kinsta in Facebook Groups, Twitter, and in migration results. Even though they’re not always #1 in Facebook polls (likely because not everyone can pay $30+/month), they are great for high traffic sites.

WPX is also very quick, but Cloudways and Kinsta are slightly faster. Starts at $20-$25/month and is who Matthew Woodward recommends.

A2 usually outperforms other shared hosting, but it’s not nearly as fast as cloud hosting (just cheaper). I use them for my girlfriend’s restaurant website and it’s decently fast with good uptimes. A2 (and all shared hosting) is only sufficient for smaller sites with lower traffic and plugins. Check this Facebook poll.

SiteGround – have gone downhill in my opinion and are no longer my recommended host. Load times and TTFB on were usually above 1s. Many complaints about their renewal prices, price hikes, CPU limits, and support isn’t as good as it used to be. SiteGround shifted to Google Cloud hosting (instead of shared) which is supposed to be faster, but they didn’t perform well. Their SG Optimizer plugin will help, but I still wouldn’t use them. You will be much better off on CW DigitalOcean.

Affiliate Disclaimer – I would seriously appreciate you using my affiliate links which means I earn a commission at no expense to you. This would help me make GoFundMe donations ($6,000 so far)! I try to base my recommendations on tests, Facebook polls, and conversations I see on a daily basis in the 30+ WP Facebook Groups I’m active on.

I would personally skip shared hosting since cloud hosting is exponentially faster. This is especially true if you’re on GoDaddy or EIG brands (eg. Bluehost and HostGator) and for resource-intensive websites running WooCommerce, WPML, page builders, or slow plugins.

There are plenty of migration results if you check Twitter and Facebook Groups. Avoid the bloggers promoting Bluehost and WP Engine because they have the highest commissions and do your research. Hosting is the #1 factor in WordPress’ optimization guide – very important!

Cloudways Response Times

Godaddy to DigitalOcean Migration

VPS Cloud Hosting WooCommerce Poll

Hosting Recommendations Facebook


2018 Hosting Recommendations

Favorite Hosting For Elementor


Vultr Migration

WordPress Hosting Suggestions

VPS Cloud Hosting Poll


July 2019 Hosting Recommendation

Elementor Hosting Recommendations


View My Full WordPress Speed Guide

Here’s my full WordPress speed guide, or watch my video. It’s a 42 minute video but I cover pretty much everything (timestamps in video description) and you will learn lots of good stuff.


FAQs / Documentation

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

wp rocket documentation

There are also video tutorials in the Tutorials tab to help configure your WP Rocket settings.

wp rocket video tutorials

Tutorials I found the most helpful:

🚀 What's the best way to configure WP Rocket?

The most important steps are to enable everything you can in the file optimization tab, set up CDNs like Cloudflare + StackPath, disable WordPress heartbeat, and activate any services you're using in the Add-Ons tab.

🚀 How do I add a CDN with WP Rocket?

If using Cloudflare, you will simply change nameservers. If using an external CDN like StackPath or KeyCDN, you will copy/paste your CDN URL into WP Rocket. If using RocketCDN (powered by StackPath), sign up through the prompt in WP Rocket.

🚀 Why was WP Rocket rated #1 in most Facebook polls?

It comes with many features other cache plugins don't have: database cleanup, heartbeat control, option for multiple CDNs, lazy loading, local Analytics, Facebook Pixel browser caching, and more. That's why WP Rocket usually yields the best results in GTmetrix.

🚀 Which image optimization plugin works best with WP Rocket?

Even though they recommend Imagify which is owned by WP Rocket, I use ShortPixel because I see virtually no quality loss and still get 100% for Optimize Images in GTmetrix.

🚀 What other speed optimization plugins do you need besides WP Rocket?

You still need an image optimization plugin like ShortPixel, font optimization (eg. OMGF), and I also recommend using Asset CleanUp or Perfmatters to selectively disable plugins.


Get Help From My WordPress Speed Optimizer

Still need help with your GTmetrix report?

I’ve been working with Pronaya for 7 years (he’s the one who optimized my GTmetrix report). You can hire him by signing up for and searching for username bdkamol. Here is his full WordPress speed portfolio. He’s $40/hour from Bangladesh (so there is a time change) and you can email him at He also has a perfect 5 star review on his Freelancer profile. Serious inquiries only, and please don’t expect 100% scores if you’re using slow hosting, a bloated theme, and tons of heavy plugins. Please follow my speed guides first.


Here are some reviews on his profile:


So… how are those GTmetrix scores looking? Let me know in the comments!

See Also: How I Got 100% Scores In GTmetrix

If you found this tutorial helpful, a share is always appreciated :)


Notify of
Oldest Most Voted
Inline Feedbacks
View all comments