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.
Watch My Video – it’s a 42 minute video, but I cover pretty much everything (timestamps in video description) and you should learn a ton of great information on WordPress site speed:
Why I Use SiteGround’s Hosting
SiteGround is used by Yoast, myself, and recommended by WordPress. They are #1 in nearly every Facebook poll and give most people significant load time improvements especially if they were using mediocre hosts: GoDaddy, Bluehost, HostGator, InMotion, Dreamhost, EIG.
I use their semi-dedicated GoGeek plan which comes with 4x more server resources than shared hosting. Click through my pages to see how fast they load, check out my GTmetrix report, or see people who migrated and posted new load times. They also do free migrations.
DigitalOcean on Cloudways and Kinsta are also good and start at $10/month and $30/month. Cloudways is more for developers who don’t need cPanel, email hosting, or the support you get with SiteGround. Kinsta is basically what WP Engine used to be (pricey, but awesome). My entire blog is basically dedicated to helping people make their website load faster. I refuse to recommend $2/month hosting since it’s most people’s biggest regret when running a website.
How To Check If Your Hosting Is Slow
Run your site through Google PageSpeed Insights to see if reduce server response time is in your report. Google recommends it should be <200ms. Anything above 1 second is not good. You can also check your TTFB (time to first byte) in GTmetrix’s Timings tab or bytecheck.com.
SiteGround is recommended by WordPress:
A few threads:
SiteGround has 3 plans which are 77% off for Labor Day:
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:
People usually migrate because their speed technology can cut load times in half:
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!