Are you obsessed with website speeds?
Designing a beautiful WordPress website is one thing, but to make it load fast, that’s another.
After years of building client sites and perfecting the speed formula, I’m finally sharing the secret.
Spoiler, there’s no secret, it’s a simple trial and error thing, feel free to copy this exactly or use it as a blueprint for you to work from.
See the live report via GTMetrix.
Disclaimer, this is not a step by step guide. If you need help setting up your website, see How To Setup Your Own Website. Before making any changes, make sure you have a backup of your website and are in a development environment to ensure you do not break anything.
Before we get into the nitty-gritty, let’s just talk broadly. Only have what you need on your website. Don’t upload countless images, plugins or themes just for the sake of it.
1. Hosting – Cloudways
Easily the most important aspect of website speed is the computer, or server which stores the web files. This is your web host, there’s good web hosting companies out there. However, I recommend Cloudways.
So, you’re using Cloudways? Great! Now how do you configure the server? Let’s take a look.
Here’s the Managing Services:
Go to Settings & Packages, Basic. Make sure to increase the Memory Limit.
Now go to Advanced, PHP.
While still in Advanced, scroll to MySQL, NGINX and Varnish. Add Cloudflare to the WAF Module, this will come in handy soon.
Now go over to Packages and update PHP and MySQL. It’s always a good idea to run the latest, stable version of these coding languages for your websites.
2. Content Delivery – Cloudflare
Let’s add an amazing connection layer to your website in the form of a Content Delivery Network (CDN) via Cloudflare. It’s an amazing service that won’t cost you anything, yes, it’s free and adds a level of privacy and security to your website.
If you’re not using Cloudflare, it’s as simple as creating an account, adding your domain and updating your name servers via your domain host. If that didn’t make sense, see How to Use Cloudflare CDN on Cloudways.
Go to Speed, Auto Minify and Brotli, tick the following boxes.
Then, go to Rules, Page Rules and apply the following 3 rules.
It’s a good idea to purge the cache after making these changes.
For a deeper dive into Cloudflare, see Caching WordPress Pages using Cloudflare Page Rules.
3. WordPress – Plugins and Themes
WordPress alone is actually good at its speed, the community of contributes and developers who build and make WordPress are always improving it.
It’s a good idea to update to the latest version of WordPress.
WordPress Caching – Breeze
There’s a lot of plugins that achieve this, I’ve tried most of them, I keep coming back to Breeze by Cloudways. It’s a free, simple (yet powerful) and user-friendly WordPress Caching Plugin developed by the Cloudways team.
When editing each section of Breeze, make sure to select Save Changes as you go.
Go to Settings, Breeze, Basic Options. Tick the following options, Cache System, Minification, Gzip Compression and Browser Cache.
Now go to Advanced Options and check Lazy-load images and Group Files for CSS and JS.
Then go to the CDN tab and select the Activate CDN option.
Lastly, go to Varnish and select the Auto Purge Varnish option.
WordPress CDN – Cloudflare
Now you’ve already set up Cloudflare, you don’t need to do that again. But there’s a Cloudflare Plugin developed by the Cloudflare team built for WordPress. See their Installation section for how to set this plugin up on your website.
To configure this plugin, go to Settings, Cloudflare, Settings and tick Always Online and Auto Purge Content On Update.
WordPress Images – ShortPixel
There are some good options out there, I like ShortPixel, a freemium, easy to use, comprehensive, stable and frequently updated image compression plugin. See their Installation guide for more details on setup.
It’s a good idea to manually compress images before you upload to WordPress and let ShortPixel do the rest.
Go to Settings, ShortPixel, General and apply the following settings.
Then, go to Cloudflare API and add settings there.
ShortPixel is awesome, just for fun, here’s how much bandwidth I’ve saved while using it.