In fact, Autoptimize doesn’t even do caching. So why use it?
Even the Autoptimize developer says on his plugin page, that it works best when combined with a cache plugin. I recommend Swift if you’re going the free route, and WP Rocket if you can do $49/year as it’s easier to configure (it’s also what I use and I have 100% scores in GTmetrix) since it comes with many features most cache plugins don’t (database cleanup, hosting Google Analyitcs code locally, heartbeat control, and integration with both Cloudflare + other CDNs). I have tutorials for WP Rocket, Swift, WP Fastest Cache, W3TC, and even WP Super Cache.
So let’s configure the Autoptimize settings. I’ll also show you how to add a CDN (ideally both Cloudflare and StackPath) since each one has their own set of data centers, and more data centers = faster content delivery. CDNs are recommended in WordPress’ optimization guide.
Optimize HTML Code – enable (fixes minify items in GTmetrix).
Optimize CSS Code – enable (fixes CSS items in GTmetrix). Test your site after enabling this.
CDN Base URL – this is where your CDN URL goes (instructions below). Cloudflare does not provide you with a CDN URL (you will change name servers instead) which I show you here. The CDN Base URL is specifically for StackPath, KeyCDN, and other CDNs (not Cloudflare). As I said, I suggest using both StackPath + Cloudflare as your CDN will have more data centers.
Step 1: Sign up for a CDN. I use StackPath who has 34+ data centers which are heavily located in the United States and is where most my visitors are. It’s $10/month with a free 30-day trial.
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 5 of this section.
Step 3: Paste your StackPath CDN URL into the CDN Base URL field of Autoptimize. You will need to add http:// or https:// at the beginning of the URL for it to work with Autoptimize…
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.
Google Fonts – enable if using Google Fonts which slow down load times as they’re pulled from external resources (the Google Font library). I prefer the “combine and link in head” option since this improves load times without visibility seeing fonts load (which is what usually happens when loading asynchronously. Also test the last Google Font option “combine and load fonts asynchronously with webfont.js” and see which yields better results in GTmetrix.
Optimize Images – URLs on your website will be changed to point to ShortPixel’s CDN. This should not effect how they look as long as it’s lossless compression, but they will load faster.
Image Optimization Quality – enable lossless compression to avoid losing image quality.
Remove Emojis – enable (emojis are bad for load times).
Remove Query Strings From Static Resources – query strings are usually generated by plugins and cannot be fixed (in GTmetrix/Pingdom) simply be enabling this, but you can try. The better solution is to check your site for high CPU plugins and replace them with lightweight plugins. Most high CPU plugins include social sharing, gallery, page builders, related post, statistic, and live chat plugins. You should also delete all unnecessary plugins and clean the database (using a plugin like WP-Optimize) to clear tables left by uninstalled plugins.
Preconnect To 3rd Party Domains – helps browsers anticipate requests from external resources (Google Fonts, Analytics, Maps, Tag Manager, Amazon store, etc). These will usually appear as “minimize DNS lookups” in your Pingdom report, but below are common examples.
Optimize YouTube Videos – if your site has videos, WP YouTube Lyte lazy loads them so they only load when users scroll down and click the play button, thus eliminating initial requests to YouTube’s servers. This can shave multiple seconds off loads times on content with videos, as they’re one of the heaviest elements on a page. WP Rocket and Swift Performance have this built-in to their settings, so you don’t need this if you use one of them as your cache plugin.
Now that we’re done configuring the Autoptimize settings, let’s move on to Cloudflare.
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 settings. StackPath bought MaxCDN and no longer uses 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).
Cache Plugins (WP Rocket / Swift)
As I mentioned, Autoptimize works best when paired with a cache plugin. WP Rocket is usually the highest rated in recent Facebook polls and is $49/year. Swift Performance Lite is usually the best free cache plugin, and I have tutorials for configuring both WP Rocket and Swift Lite.
I use SiteGround and have 200ms response times with 100% GTmetrix scores and .4s Pingdom load times. Do a hosting check, run your own tests, or click through my fast loading pages. They were rated the #1 host in 26 Facebook polls and are worlds better than EIG (Bluehost, HostGator), Godaddy, and other hosts who pack too many people on the same server. There have been plenty of people who migrated and posted results on Facebook and Twitter. Tweetafter tweet, post after post, poll after poll after poll, faster hosting will fix slow response times. They’re recommended by WordPress, do free migrations, and I use their semi-dedicated plan.
I use SiteGround because…
- My GTmetrix + Pingdom report speak for themselves
- They use PHP 7.3, NGINX, HTTP/2, Cloudflare, fast speed technology
- Average load time is 1.3s, giving most people instant speed improvements
- They’re recommended by WordPress and Ivica from WordPress Speed Up
- Free Let’s Encrypt SSL, easy to use cPanel, and features for eCommerce
- Renewal prices are a price jump, but you can get 3 years of the promo price
- Always been known for great support (tickets usually answered in <10 min)
- I always get 100% uptimes but 99.99% is guaranteed (includes daily backups)
- They do free migrations, have a migrator plugin, and 30-day money back policy
- They’re based in Chicago (my hometown) and have 4 data centers to choose
Affiliate Disclaimer – if you sign up for SiteGround using my affiliate link I would genuinely appreciate it. Each year I donate $3,000 to GoFundMe campaigns (2018 was to feed the homeless, and 2017 was to Hurricane Harvey). Your support helps, and I know there are tons of affiliates out there. I try to make my reviews unbiased and backed by evidence in the form of Facebook polls, tweets, and real conversations. If you don’t want to use it, here’s a non-affiliate link to SiteGround. Either way I truly believe they’re the best host and that your site will run faster/smoother… do your research on Google and Facebook groups and you’ll find most people say the same.
They have 3 plans:
Higher plans include more server resources (#1 factor in the WordPress optimization guide). Here’s the full comparison chart, but GrowBig gives you about 2x more server resources than StartUp, and GoGeek is semi-dedicated hosting which gives you even more. GrowBig and up comes with a free migration, staging, advanced caching, and ability to host multiple websites. GoGeek comes with priority support. Their cloud hosting is quite the price jump at $80/month.
You can see this on their features page…
One of many threads…
Want To Know How I Got 100% Scores In GTmetrix?
See my full WordPress speed optimization guide which has over 38 tips in fixing GTmetrix/Pingdom items including upgrading to PHP 7, serve scaled images, specifying image dimensions, database cleanup, AMP, hosting Google Analytics locally, WP Disable, and others.
Questions? Drop me a line!