How to optimise your WordPress site using a CDN?
Why is website speed important?
Site speed is one of the key factors to measure a site’s performance. A site that takes too long for content to load, and keeps the user waiting has a high risk of being abandoned by the user.
The world wide web is competitive, there are many sites offering very good content, all a couple of clicks away. So unless users already know your site or are specifically interested in that particular article, there is a good chance that they will go to another site, if their first choice keeps them waiting too long. (a couple of seconds can make all the difference!).
But how long is too long?
The same rules can’t be applied to every site, where benchmarks are different for corporate sites, e-commerce sites, or blogs. The differing factors can be the size of the page, number of images, or even the topic of the site – different users have different behavioural patterns. The answer to the question also changes with the device. For example, if the site is visited from a mobile device on a mobile network, the loading time will be longer than from a laptop or a desktop.
As a rule of thumb, it shouldn’t take longer than 3 seconds to load a site on a desktop device, and no longer than around 7 seconds on mobile devices. While load speed of the full site is important, there are other key ways to measure the quality of a site. For example when a user is able to see some meaningful content even if the site is not fully loaded.
‘Faster is better and less is more’
The above is a great way to summarise the attitude to site speed. But if you’re looking for something more in-depth, you can find comparison charts for some of these key metrics organised by country and industry from Google here.
So now that we have established that good sites are fast sites, should you optimise yours through a CDN?
How does a CDN work?
CDN stands for Content Delivery Network. But this doesn’t mean that the site will be hosted in multiple servers. A CDN is a network of servers distributed all around the globe where the static content of the site like stylesheets, javascript files, images, video etc will be cached.
So when a CDN is in place the site content will not always be delivered from the server where it’s hosted. When someone accesses the site from their house, their office, or maybe from the beach using their phone (who knows!) the content will be served from the closest server for them, depending on their geographic location.
At the end of the day, data needs to travel just as we do, and the shorter the distance the faster it will be available to the end user. Shorter waiting times translate into happier users.
Furthermore, CDN not only helps to improve the loading speed of a site, it also helps to improve the SEO ranking of the website. A faster site means a better user experience, which in turn Google rewards from a SEO angle.
A CDN can also be a security measure that helps to prevent a server from crashing if lots of users try to connect to the site at the same time. In virtue of this it is also a good measure against DDoS attacks.
Some of the more well known, and commonly used tools that help to analyse the performance of a site:
It’s always recommended to test the site in more than one of these tools, as they can show different results and provide different information points. Testing on a few tools will help you see the bigger picture and gain a better understanding of how your site is performing.
What to consider before using a CDN?
Before adding a CDN there are a few points that need to be considered. For example, where are the main users based? If they are local it may not be necessary, and sometimes adding a CDN could lead to errors that are potentially tricky to handle.
Before you go straight for that CDN add-on to improve your site speed, consider these as things to do to speed up your pages first:
- optimising images
- using good quality plugins
- optimising the MySQL database
- server caching
- using a well built WordPress theme
- loading only the necessary JavaScript and CSS
These are really foundations, and if you think that a CDN would help improving your site performance beyond this, these are some of the most popular WordPress CDN providers:
Our preferred hosting partner, WP Engine, also have a built in CDN into their WordPress hosting platform, so in most cases on client projects we make use of the WP Engine CDN that is ready to go out of the box unless there is a particular need to use a different platform.
Optimise your WordPress site with Cloudflare
Getting to grips with PRINCE2
Let's Talk
Do you have a web design and build project coming up that you would like to talk about?