But Why is Speed so Important?The importance of a fast website has been researched over and over again. Sites which are not fast enough create a negative perception, with the actual loading time of a site significantly affecting the conversion rates of websites. As the loading time gets higher and higher, the conversion rate goes down significantly, with the optimum conversion rate happening at a page load time of 2.4 seconds.
What is a CDN and How Can it Help Speed Up My Sites?Whilst there are many benefits to using a CDN which we will discuss shortly, there is one basic premise of how a CDN makes your site faster. Simply put, a CDN is much better equipped as a network to handle the traffic of a website than most hosting services. Shared hosting is typically optimized towards delivering a stable environment where your website can run PHP or other popular hosting environments. It’s not geared towards optimizing for speed most times. On the other hand, a CDN’s primary aim, and actual infrastructure setup is geared towards helping deliver a lightning fast website. But how does a CDN actually speed up my site?
How a CDN’s Infrastructure Speeds Up Your SiteThere are a few reasons why your website could be slow:
- your shared hosting server is overwhelmed and responds slowly;
- the images and content of your site are large and take a lot of time to download;
- your website is using too many different scripts and images which are not optimized for a fast loading website;
- the server location of your site is in a geographically different region than the visitors of your website.
Your Shared Hosting Server is Overwhelmed and Responds SlowlyShared hosting servers are not meant to be fast. They are meant to be affordable. The economics of shared hosting means that to drive down the costs, the number of different websites hosted on the same server is significantly high. That means, each time somebody visits your website, the hosting server is competing for resources with ALL of the websites hosted on the site, which means it typically takes more than a second to start serving your website. Now, when we’re talking about making a website, a penalty of a second before we start doing any optimizations is a terrible way to start. So a couple of recommendations:
- If your website is hosted with WordPress, you need to find a reliable WordPress hosting company, with great reviews, which is not cheap.
- Opt for a higher payment plan, ideally a VPS, such that your site will have enough resources and won’t be competing with hundreds of other sites
The Images of Your Site are LargeOne of the largest impacts your site can have in terms of loading time, typically comes from the images hosted on your site. You’ll find plenty of blogs touting the value of using images in your website and blog, and of course, this is excellent advice. Images are necessary to break up large chunks of text and make for better readability. Who also hasn’t heard of the phrase: “An image is worth a thousand words” Yes, images are vital to the success of your site. Yet, they have a drawback. Unoptimized images can kill the loading time of your site. Now, in an ideal world, we’d take the recommended approach of saving each file in a web-friendly format, optimizing large images and compressing them to a size which is acceptable without losing any of the quality. Yet in reality, we simply don’t have the time or the inclination to go through an optimization process for each and every image. But, there is a solution. Automation. Once, again, CDNs come to the rescue. Image compression and optimization is typically a built-in feature of a CDN. In essence, you go about your business of creating a great-looking website with awesome imagery, the CDN will handle the compression and optimization of the images.
- Keep your site as lean as possible from plugins, less is more
- Combine, compress and minify scripts
- Enable HTTP/2
How to Setup a Free CDNThe great thing about using a CDN, is that you can easily boost the speed of your website without having to pay anything extra, particular if your website is still growing. Most CDN services offer a free plan, which will provide the essential caching functionality we discussed above. Typically, besides content optimization, you’ll also got a boost in your website’s security too, through the security mechanisms implemented by CDNs. As your website grows and the needs of the site grow, you’ll then be able to upgrade to a plan which suits your needs better. There are a couple of ways of setting up a CDN, this mostly depends on the actual CDN you will be using.
Install a CDN PluginThe first way of setting up a CDN is by using a CDN plugin. When setting up your CDN, you will get a URL which will be the new location of the static images of your site. The CDN plugin will rewrite the URL of static resources such that they will be served from the CDN. https://www.example.com/images/logo-default.jpg is now rewritten as https://cdn.example.com/images/logo-default.jpg You’ll need to perform a few slight changes to the DNS entries of your site, such that cdn.example.com will resolve as the URL provided by your CDN. You can use the CDN Enabler plugin if you’re using URL rewriting service such as KeyCDN (the authors of this plugin), MaxCDN or Incapsula. Once you’ve installed this plugin, the only thing you’ll need to do is enter the URL provided by your CDN service, and you should be good to go.
Install a CDN as a Reverse ProxyAnother, better way of installing a CDN is using a reverse proxy. This also requires minor changes to your DNS, which are typically specific to the CDN you will be installing. This implementation is advantageous because it removes a significant load from hitting your server directly.
Are You Ready to Take Your Website to the Next Speed Level?As we’ve seen above, installing a CDN is not as prohibitive in terms of price as one may think. Besides that, the performance boost given to your site will be a significant UX improvement. If you’re looking to speed up your site quickly, a CDN is a must-have.
David is an inquisitive web designer who frequently shares his tips and tricks at CollectiveRay. When he's not blogging about web design, some thing he's been into for the last 12 years, he's usually dreaming about his next big thing.
As a creative professional, navigating the digital realm is second nature to you. It’s normal to follow an endless…
By Louise North
Remember when Merriam-Webster added Photoshop to the dictionary back in 2008? Want to learn how AI is changing design…
Remember the screech of dial-up internet? Hold fond memories of arcade machines? In this list, we’re condensing down 30…
There are over 5.4 billion mobile users today, meaning that over 68% of the population tap into an online business via…
How far would an organization be willing to go for the chance to generate a little extra buzz? In this list, we're…
By Robert Reeve
We’re all familiar with rebrands going wrong, but what happens when they go right? From McDonald’s health kick to…