The Ideal Swift Performance Settings With Cloudflare + StackPath CDN Setup Instructions (With Facebook Polls) – 2019, Version 2.0.5

Swift Performance is the new cache plugin on the block, which has been getting raving reviews in the WordPress Speed Up Facebook Group.

I’ve been using WP Rocket and already had 100% GTmetrix scores with a 1s load time (hard to beat), but Swift gave me near identical results. I stuck with WP Rocket, but I would rate Swift Performance Lite the #1 free cache plugin ahead of WP Fastest Cache, WP Super Cache, W3 Total Cache, and the others. The Swift Performance settings are relatively easy to setup (I’ll walk you through everything). The Pro Version includes an image optimizer (for lossless compression + automatic image resizing), critical fonts, compute API, and support for their plugin. Cool part is, they have an option to pay monthly so you can try it for only $3.99/month.

Swift vs. WP Rocket – these are usually the top cache plugins in recent Facebook polls…

Swift-performance-vs. -wp-rocket-poll

Swift-performance-vs. -wp-rocket



  • Free (lite) version = amazing results
  • Mediocre documentation
  • Free version includes plugin organizer
  • Pro version includes critical fonts
  • Pro version includes image optimizer
  • Free

WP Rocket

  • Easier to configure
  • Better documentation
  • Facebook Pixel + Sucuri add-ons
  • No plugin organizer
  • No image optimizer
  • $49/year

Both Swift and WP Rocket support Cloudflare, CDN, heartbeat control, preloading, lazy loading photos/iframes, hosting Google Analytics locally, minification, script merging, gzip compression, and other features. They are actually very similar as far as their features go.


1. Wizard

The Wizard analyzes your site and helps configure basic Swift Performance settings. The out-of-the-box settings work great, but there are still more ways to optimize when you’re done…

Things You Still Need To Do

  • Tweaks → Cache Gravatars
  • Hearbeat → Disable All
  • Google Analytics → Bypass Google Analytics
  • Styles → Generate Critical CSS
  • Caching → General → Separate Mobile Device Cache (if using AMP or mobile theme)
  • Varnish → Custom Host
  • CDN → StackPath CDN
  • CDN → Sign up for Cloudflare and change name servers
  • Optimize Images (using Swift Pro or Imagify/Imsanity)
  • Database Optimizer → clean database
  • Plugin Organizer → enable/disable plugins on specific content







2. Dashboard

The dashboard shows stats, like how many known pages Swift detected vs. how many are actually cached. Swift also assigns each URL a prebuild priority and the date eache page was last cached. In the Warmup table, you can also manually add URLs if Swift didn’t detected it.



3. Settings

The general, media, optimization, caching, and CDN tabs are broken down into sections:


3.1. General


  • Disable Cookies – for GDPR when asking users to agree to cookies.
  • Hide Footprints – hide swift comments in the source code.
  • Use Compute API – speeds up merge settings and decreases CPU usage.
  • Enable Remote Cron – Swift’s API server will call wp-cron.php and run WP cronjobs as real cronjobs.
  • Debug Log – see warnings/errors shown in the log path (eg. public HTML folder).



  • Normalize Static Resources – attempts to remove query strings, however these are usually generated by slow plugins. The main way to get rid of them is to deactivate high CPU plugins (found in GTmetrix Waterfall) and replace them with lightweight plugins.
  • Prefetch DNS – anticipates external resources (eg. Google Fonts + YouTube videos).
  • Collect domains from scripts – helps with prefetching DNS.
  • Exclude DNS Prefetch – exclude domains you don’t want to be prefetched.
  • Gravatar Cache – caching Gravatars usually isn’t enough, you also want to offload them to a CDN and load Gravatars locally as explained in WP Rocket’s Gravatar tutorial. This improves load times for posts with lots of comments, as some of my posts have 300+ comments where Gravatars have suck up over 50% of load times.
  • Gravatar Cache Expiry – time Gravatar cache will expire (3600 is fine for most sites) but you can increase this if you notice it’s consuming too much CPU. If too high, users will never see the cached version. If too low, it can consume too much CPU.
  • Custom Htaccess – setup redirects or use it for other things.


Speeds up WordPress admin and reduces CPU by disabling the Heartbeat API. This notifies users when content is being edited and allows plugins to send real-time notifications (adding requests). Disabling it saves CPU (PerfmattersHeartbeat Control plugin do the same thing).


Google Analytics
Bypassing Google Analytics can fix items in GTmetrix/Pingdom related to Google Analytics. CAOS, Perfmatters, and WP Rocket’s Google Tracking add-on also help fix items related to GA.




3.2. Media


  • Optimize Images on Upload – losslessly compress images which fixes “optimize images” in GTmetrix (only for the page you test). Imagify does this too and is what I use.
  • JPEG quality – keep at 100% to avoid lossy compression.
  • PNG quality – keep at 100% to avoid lossy compression.
  • Resize Large Images – resizes large imager to correct dimensions (many people upload oversized images). This fixes “serve scaled images” in GTmetrix. Imsanity does this too.
  • Keep Original Images – when Swift resizes large images, it will keep the original in case the new image isn’t the size you want it, so at least you have a backup of each image.
  • Inline Small Images – small external images are written directly into the HTML document, so the browser does not request those image files independently.
  • Lazyload – only loads images once you scroll down the page and actually see them. While this improves initial load times, it also means users constantly see images loading as they scroll down, which can be annoying. That’s why I only lazy load videos + iframes.
  • Force Responsive Images – uses the srcset attribute to provide several image sources for browsers so they can pick the right one.



  • Lazy Load Iframes – only loads iframes once you scroll down and see them.
  • Exclude Iframes – exclude certain iframes from being lazy loaded.
  • Load Iframes on User Interaction – only loads iframes when users interact with it (using the mouse move, roll, or touchstart).



3.3. Optimization


  • Merge Assets for Logged in Users – disable, as it doesn’t improve load times and will likely do more harm than good, plus most optimizations should be on front-end.
  • Optimize Prebuild Only – disable unless you want to control when cache is built.
  • Optimize in Background – Swift will optimize pages in the background.
  • Fix Invalid HTML – some plugins/themes use invalid HTML, Swift will try to fix this.
  • Minify HTML – fixes multiple items in GTmetrix/Pingdom. Cloudflare takes care of this too, so you should only have 1 enabled (Swift or Cloudflare).
  • Disable Emojis – emojis add requests and hurt load times.
  • Limit Simultaneous Threads – speed of cache rebuild (lower if having CPU issues).
  • Maximum Threads – lower numbers = less CPU usage (2 is good).
  • DOM Parser Max Buffer – Swift developer set this numbers for a reason.


Merging/minifying JavaScript is notorious for causing errors, but I would test these and check your load times. If you see errors, find the problematic files and add them to ‘Exclude Scripts.’

  • Merge Scripts – many people say disable it, but I would test it.
  • Async Execute – JavaScript will theoretically load as 1 request and will be executed while the script is still loading, but it can also break things, so test option carefully.
  • Exclude 3rd Party Scripts – enable if using Merge Scripts, disable if you’re not.
  • Exclude Scripts – exclude problematic files if minifying JavaScript results in errors.
  • Exclude Inline Scripts – exclude problematic files if Merge Scripts results in errors.
  • Exclude Script Localizations – Swift developer recommends enabling it, otherwise you may have separate JavaScript files for all your pages.
  • Minify Javascripts – enable and check your site. If you see errors, exclude problematic files under Exclude Scripts (Cloudflare also does this, so only enable one).
  • Minify with API – enable only if default Minify JavaScripts option results in errors.
  • Proxy 3rd Party Assets – Swift says it can fix browser cache issues in GTmetrix related to GA, but can break scripts. Bypassing Google Analytics is a better option. Test it out.
  • Separate Scripts – saves merged JS files for pages separately. Generally this consume more CPU than it does good.
  • Print merged scripts inline – only enable if using memcached and WordPress can’t write your files.
  • Lazy Load Scripts – lazy loads external resources which can improve load times.
  • Include Scripts – include certain scripts not detected by Swift.


CSS optimization can also cause errors, but can greatly improve scores/load times. Play with the settings and check a few pages to make sure everything is OK. If merging stylesheets and minifying CSS cause errors, locate/exclude problematic files (same things with JavaScript).

  • Merge Styles – recommended by Swift developer and fixes items in GTmetrix/Pingdom.
  • Generate Critical CSS – CSS will be loaded asynchronously, however the developer says this can increase CPU.
  • Print full CSS inline – developer says you shouldn’t need this.
  • Separate Styles – disable unless you have pages with different content types (eg. some use Visual Editor, some use Page Builders, etc) and need Swift to generate a different merged CSS for each page. May improve scores, but can increase CPU. Test carefully.
  • Minify CSS – enable, but this can cause issues so test your site (Cloudflare also does this, so only use one). If you see errors, exclude problematic files under Exclude Files.
  • Bypass CSS Import – enable (this merges imported CSS files as well).
  • Exclude 3rd Party CSS – if Merge Scripts is giving you problems, try this.
  • Exclude Styles – exclude problematic files if minifying CSS results in errors.
  • Include Styles – manually include styles if you’re not using Merge Scripts.



3.4. Caching


  • Enable Caching – enable.
  • Caching Mode – disk cache with rewrites is generally fastest for most sites. If you can’t edit the .htaccess file or Nginx config, use Disk cache with PHP. If memcached is installed, select memcached with PHP, but always try to use disk cache with rewrites.
  • Early Loader – enable unless it’s causing PHP issues.
  • Cache Path – specify directory for the cache path.
  • Cache Expiry Mode – time-based is best for nearly every website.
  • Cache Expiry Time – time cache will be regenerated. Too often and it will consume CPU, too little and users won’t see the cached version. 12 hours is good for most sites, but you can decrease this if you have time sensitive content (or clear cache manually).
  • Garbage Collection Interval – how often Swift checks for expired cache pages. 30 minutes is good, too high and it will consume CPU.
  • Clear Cache on Update Post by Page – add pages/posts where you want the cache to be cleared once it is updated, so users can see the new content.
  • Clear Cache on Update Post by URL – same concept as previous settings, only by URL.
  • Enable Caching for logged in users – enable if multiple users are logging into your site (eg. bbPress). This gives each user their own cached version, otherwise keep it disabled.
  • Separate Mobile Device Cache – enable if using AMP or a mobile theme.
  • Case Insensitive URLs – shouldn’t make a difference.
  • Enable Browser Cache – enable.
  • Enable Gzip – fixes gzip items in GTmetrix/Pingdom.
  • Send 304 Header – disable.
  • Cache 404 pages – enable, since spiders may be crawling invalid URLs and consume CPU. Caching 404 pages and serving them from a CDN cuts down on server resources.
  • Ignore Query String – doesn’t cache pages that are different for each user (unique sales pages if you run FB/Google ads, membership profiles, conditional logic on forms).
  • Enable Dynamic Caching – lets you specify cacheable $_GET and $_POST requests.
  • Cacheable AJAX Actions – cache resource-intensive AJAX requests by specifying their names here.
  • AJAX Cache Expiry Time – leave as 1440.

Depending on what assets your site uses, you may not want to cache certain static files (some common ones are eCommerce cart/checkout pages, admin, XML sitemap, and search pages.

  • Exclude URLs – exclude specific URLs from cache.
  • Exclude Content Parts – exclude specific content parts from cache.
  • Exclude User Agents – exclude specific user agents from  cache.
  • Exclude Crawlers – exclude specific crawlers from cache.
  • Exclude Author Pages – exclude specific author pages from cache.
  • Exclude Archive – exclude specific archives pages from cache.
  • Exclude REST URLs – exclude specific REST URLs from cache.
  • Exclude Feed – exclude specific feeds from cache.

Warmup stores URLs in for the next cache prebuild. Each URL has a priority number (shown in the dashboard settings) where they can be adjusted manually. Lower number = higher priority.

  • Enable Remote Prebuild Cache – Swift will no longer use an external bot for prebuilding and will use the background process instead.
  • Prebuild Cache Automatically – prebuilds cache after it’s cleared. If using this, also enable “Optimize Prebuild Only.”
  • Discover New Pages – if Swift can’t find all your pages, this will help.
  • Prebuild Author Pages – prebuilds author pages.
  • Prebuild Archive – prebuilds archive pages.
  • Prebuild REST URLs – prebuilds REST URLs.
  • Prebuild Feed – prebuilds RSS feed pages.

Enable Auto Purge – enable if using varnish cache – it will automatically purge it when Swift clears the plugin cache so you don’t have to do it manually.

Appcache downloads your site (or specific pages) into the user’s browser on their first visit, making your website available even when they’re offline. Sounds great, but this significantly slows down your prebuild and is not worth it. I highly recommend leaving these disabled.

  • Enable Appcache for Desktop – disable.
  • Enable Appcache for Mobile – disable.


3.5. CDN

I use StackPath ($10/month with 30-day trial) in conjunction with Cloudflare. StackPath has 31 data centers, Cloudflare has 150+. More data centers = faster content delivery, and StackPath’s are heavily located in the US which is where, at least, most of my visitors are.



Step 1: Enable CDN.

Step 2: In the StackPath dashboard, click the CDN tab, and create a StackPath CDN Site




*Copy your server IP address as it is needed in step 4 of this section.


Step 3: Paste your StackPath CDN URL into the CDN Hostname field of Swift Performance.


Step 4: In StackPath go to CDN → Cache Settings, then click “Purge Everything”…


Step 5: Whitelist your server IP address in StackPath (WAF → Firewall).


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

Cdn gtmetrix yslow

Enable CDN on SSL – enable if using SSL.

SSL CDN Hostname – leave blank since hostnames are the same even if it’s SSL.


Cloudflare adds even more data centers to your content delivery network…

Cloudflare data centers

Step 1. Sign up for Cloudflare and you will be prompted to add your site and begin a scan.


Step 2. Once the scan is done, select the free plan, then Cloudflare will take you through a set of pages. You will eventually be taken to a page where Cloudflare assign you 2 name servers.


Step 3. Do a Google search for “how to change name servers on SiteGround” (only search for your host), then follow their instructions. You will be copying the 2 name servers provided by Cloudflare and pasting them into a custom name servers option in your hosting cPanel…


Step 4. Grab your Cloudflare Global API Key (found in your Cloudflare profile) and enter it into Swift’s Cloudflare tab. Use the same email as your Cloudflare account, and enable auto purge which purges Cloudflare’s cache when Swift’s cache is cleared (so you don’t have to manually).


MaxCDN / StackPath
You can ignore these options. StackPath bought MaxCDN and they no longer use an Alias, Consumer Key, or Secret. Simply create a StackPath CDN URL and enter it in the CDN tab.

  • MAXCDN Alias – outdated (use StackPath CDN URL).
  • MAXCDN Consumer Key – outdated (use StackPath CDN URL).
  • MAXCDN Consumer Secret – outdated (use StackPath CDN URL).



4. Image Optimizer

Swift Performance’s image optimizer is good, but you don’t need to upgrade for this (you can use free image optimization tools/plugins): Shortpixel, Imagify, and Imsanity all do a great job.


5. Database Optimizer

The database optimizer deletes unused database tables (often left by plugins you uninstalled), transients, autosaves, trashed posts, spam comments, and potentially thousands of post revisions which are automatically stored each time you republish content. For the most part, it’s junk. Take a backup especially if you haven’t done this for awhile, as it cannot be undone.



6. Critical Font

Critical fonts let you select icons from Font Awesome and efficiently load only the ones you choose, as oppose to the entire Font Awesome library, making these icons load much faster.



7. Plugin Organizer

In your GTmetrix Waterfall tab, you may notice certain plugins are running on pages/posts where it’s not even being used. Contact Form 7 might be used on your contact page, but usually nowhere else (so it shouldn’t run anywhere else). My WP Review rich snippets plugin do this too. You can disable/enable plugins using Swift’s filters while adding multiple rules.



  • Enable URL Match /contact/ to only show Contact Form on that page
  • Disable certain plugins in your WordPress Admin to prevent CPU consumption
  • Enable URL Match with regex expression to only show rich snippets on ‘review’ posts


8. Upgrade PRO

Swift Pro lets you use their compute API, image optimizer, and critical fonts. Frankly I think they give away too much in their free (lite) plugin, and that these aren’t worth upgrading for.


9. Test Results In GTmetrix

With Swift Performance…

With WP Rocket…



Swift Performance Lite blows other free cache plugins out of the water, even if you configure just basic settings using the Wizard. If you’re still have issues, see my full WordPress speed optimization guide which includes a list of high CPU plugins to avoid, lightweight plugin alternatives, AMP instructions, how to upgrade to PHP 7+, image optimization, and a link if you want to hire my developer on who helped me get a 100% GTmetrix score.


Frequently Asked Questions

Is Swift better than WP Rocket?

WP Rocket was rated higher in most Facebook polls, is much easier to configure, and has documentation/support if you need help setting it up.

How do you setup Cloudflare with Swift?

Sign up for a free Cloudflare plan, copy the 2 nameservers provided by Cloudflare, and change nameservers to Cloudflare's in your domain registrar. Next, add your Cloudflare information (located in your Account tab) into Swift Performance's Cloudflare settings.

How do you use the plugin organizer?

Learn which pages/posts don't need certain plugins/scripts. This may require a bit of testing. Next, use the Plugin Organizer to disable those on pages/posts that don't need to load them. Only loading a Contact Form plugin on your contact page is a classic example.

What other speed plugins do I need?

Swift should take care of most speed optimizations. You need to look at your GTmetrix report (including the Waterfall tab) to see what exactly is slowing down your WordPress site. For images, I recommend ShortPixel. For fonts, you can try OMGF.

Is Swift Performance Pro worth it?

If you're going to pay for a premium cache plugin, you're better off paying for WP Rocket than Swift Performance Pro.

Thanks for reading – drop me a comment if you have any questions!

About Tom Dupuis

Tom Dupuis writes WordPress speed and SEO tutorials out of his apartment in Denver, Colorado. In his spare time, he plays Rocket League and watches murder documentaries. Read his bio to learn 50 random and disturbing things about him.

15 thoughts on “The Ideal Swift Performance Settings With Cloudflare + StackPath CDN Setup Instructions (With Facebook Polls) – 2019, Version 2.0.5

  1. Based on SWTE Group, Ltd’s / Swift Performance unethical billing practices, I recommend going with any alternative to Swift products. If you look at reviews, you’ll see many accounts of volatile and unstable products for Swift Performance plugins and unfortunately a very disappointing consumer experience. I canceled my subscription the day of my renewal and they charged me anyway and responded with a scripted rebuttal to refused to refund me regardless of my account status. Stay away

  2. I’m wondering whether if i go for WP rocket or Swift performance pro. I’ve tried swift lite and couldn’t fix many issues on CSS, so added Autoptimize. It made the speed so fast, but it screwed up the mobile look. it looked like from 80s despite of 0.3 sec loading time. I came across your youtube and installed Cloudflare. then I found this. I was setting up in the way you did, i could somehow fix the mobile look problem, now i have slower and lower score on GTmetrix 90, not 99 anymore. I’m super newbie, so not having help button/explanation on Swift is hard for me. And your overall comparison of your speed was WP rocket…You said I should have minimal plugins. I also transferred host from Bluehost to Siteground as you said to speed up.I heard Siteground offers great in-house tools to speed things up.Which plugin should i get? I optimize images because I focus on pinterest marketing and use canva a lot. But you said plug in won’t work for images already compressed.. What’s the must plugins to have as a blogger? It’s so overwhelming.. It’d be great if you can give me advice on plugins. Thank you.

    1. Hey Akiko,

      I’ll try to answer all your questions but let me know if you need any clarification.

      WP Rocket is much easier to configure than Swift and usually yields better results. They also have support as it’s a premium plugin. Just be sure to configure everything correct (eg. I have a tutorial on the settings) and you can get 10% off on their Coupons page. You might have better luck with WP Rocket – it’s also what I use. If using SiteGround, you may also want to test their SG Optimizer plugin.

      The problem is, each website is different, and different cache plugins yield different results depending on the website and cache plugin’s configuration. That’s why testing is required, but only test 1 at a time.

      Using the right (lightweight) plugins is more important than the amount of plugins. There seems to be an error with your website now but when you run your site through GTmetrix, look in your Waterfall tab and you will see exactly what is slowing down your site – whether it’s plugins, images, fonts, etc. If it’s a certain plugin causing your site to be slow, try to find an alternative lightweight plugin (do your testing in GTmetrix whenever you add new plugins to see how it affects your load time).

  3. Tom, you said you are on a Siteground GoGeek plan in the article. But I can see that you are using their VPS server.

    1. I literally just switched to DigitalOcean on Cloudways about 4 days ago and am in the middle of revising my hosting recommendations. SiteGround is great for shared, but Cloudways is managed cloud hosting and cut my response time by 2x. Support isn’t as good, but speed is better.

      1. Please share your experience and review in your next post. I am on siteground gogeek plan I am happy but want something more.

  4. Thanks for this guide. It really helped me. Thanks once more. I really recommend Swift over Wp-Rocket. I have used both.

  5. Hi, have you tried SiteGround’s own cache plugin? I found they incorporated a lot of other features so you can actually have one plugin and avoid installing many others. Maybe you can write an article for SG users for anything else they should have? (such as Sucuri?)Thanks!

    1. Hey Annie,

      Yes I have tested it out. Long story short, their dynamic caching is faster than any other cache plugin. However, it still lacks features that come with Swift + WP Rocket. I use WP Rocket still, but may consider switching if they release even more speed features (database cleanup, integration of a CDN URL, etc). Until then, stick with Swift or WP Rocket.

    1. I still recommend WP Rocket if you can afford $39/year and have a decent sized site where speed is important, or just want a cache plugin that’s easy to configure. Otherwise, if going free, Swift is a good alternative. I still use WP Rocket.

Leave a Reply

Your email address will not be published.