Improve Conversion Rates – Load Times
You’ve come a long way in web design since the early days of the internet, when people would get on your website and wait just to be able to view your product. It can often take up to three seconds for your site load before you start noticing a drop in conversions. That’s now an eternity online. So what are some ways that you can speed up page-loads while still keeping your brand’s visual identity? And what are some examples of companies who have pulled it off successfully?
Easy methods available include: loading in content from external sources, pre-rendering assets and images, and using CSS sprites. But there is a much more extravagant solution; Content Delivery Networks (CDNs). A CDN is a network of computers strategically placed across the world to serve content efficiently. It’s also much cheaper than you think. Most costs are calculated based on how much data you transfer through their servers. So if you can keep it to minimum, it should be free most of the time.
The New York Times is one of the most visited websites in the world and they use a CDN for all their images that they choose to host externally. That means that all images hosted on the New York Times website load instantly without having to be pre-loaded or before any user interaction has taken place (such as hovering, clicking, etc).
Another great example of a CDN is YouTube, who also use a CDN for all images on their website. Although they do still host some of their smaller images on their servers, the majority of their content is pre-loaded via a CDN. This makes it so any one visiting the YouTube homepage will not experience any delay in loading.
But before we get ahead of ourselves, I’d like to give you an example of what this looks like in practice. Lets take the following page from Wikipedia – well known for having some very large images. Because it hosts all its images externally, every time you load the page you’ll notice that three seconds is wasted before you see any content.
http://en.wikipedia.org/wiki/File:Canton_of_Chartres_Bretonne_-_Traite_canalis_-_-ensemblissement-de-chartres-30x33.jpg
But what if we were to host all the images on our own website? That would mean that every page we have would load instantly, which will naturally increase conversions.
http://todorovic.co/blog/how-to-increase-conversions-with-cds/
I know what you’re thinking – that’s a lot of work! Well, it certainly is. But there are some easy methods that you can implement regardless of whether or not your website is hosted externally or internally. Some great examples include: loading in content from external sources, pre-rendering assets and images, and using CSS sprites.
Loading in content from external sources
When you link to an external source, your website will load that external source before loading the actual page. This means that the user doesn’t have to wait for anything else to load, minimising overall load times significantly. An example of this is when you click on a YouTube video – the video loads instantly without having to wait for the website itself to load first. This is because YouTube uses a content delivery network (CDN) for all of its videos; it speeds up loading by hosting its videos on servers closer to you. The downside with this method is that not every website can use it, as not every website can host external content. Many websites are restricted to hosting only local content from their own site. So if you use this method of loading in content externally, it’s important to ensure you have a great quality CDN for your images.
One really good example of a website using external content is Twitter which has its tweet structure stored on external servers. This means that the tweet displayed to the user will load instantly and the website itself will be quick to load also. There are also some other companies out there who host all of their images and videos on their own CDN – check out Amazon, Netflix, Facebook and Spotify.
Pre-rendering graphics and images
The next method is about pre-rendering your graphics and images. This allows you to load in those images without waiting for them to be requested from the CDN. The results are that the user does not have to wait for anything else to load before they see your actual content and it also speeds up page loading dramatically. An example of this is if you were designing a shopping cart, you would want all the graphics on that cart pre-rendered for incredibly fast loading – this would mean that a customer could view their cart immediately without having to wait for it to build before they view their products. If you were to pre-render all of your images and assets whilst building your website, it would be ready for your customers right when they come in.
There are a few ways to go about this process and the most effective way relies on the use of PHP and JavaScript. Let’s start with what we want to achieve. What we need is a way to find all of our assets, then immediately render all of them without any user interaction. There are two processes that we can use for this: scanning our current directory structure or scanning an array of existing data.
To be able to find all images that are currently on the server, we can use PHP’s include_once() and include() functions. This is an easy way to force all images that exist in our current directory structure to load and therefore we can use the following script:
<?php include_once "inc_includes.php"; //include header files require "inc_includes.php"; //scan libraries in case there are any included files $extensions = array("jpg", "gif", "png" ); include("includes\imgs.php"); //image retrieval ends here
The example above will load in inc_includes.php which will include any required header files and then scan through all of your existing images using includes\imgs.php . Inc_includes.php will then automatically load all the images that are hosted externally. This means the user will not have to experience any delays whilst they see their content. In order to be able to use PHP’s include_once() function, ensure that your image extension doesn’t have any characters in it – including underscores or hyphens like -1 , -2 , etc.
CSS Sprites
This method is another great way of speeding up load times for your website without having to change anything. CSS sprites allow you to pre-render all your graphics through CSS, so they load instantly upon being requested while still looking great and feeling responsive on mobile devices.
Conclusion
As discussed in this article, we’ve gone over some ways you can improve page loading times for your website. If you are using the WordPress platform, you can start making some changes immediately. I would definitely recommend looking at what PageSpeed Insights says about your website – it will give you a very good indication of where things need to be changed.
https://developers.google.com/speed/pagespeed/insights/?hl=en#scorecard&url=http%3A%2F%2Ftodorovic.