Why it's important to have a fast website, and how to make improvements

03 February 2010 website, performance

F-22 Raptor Fighter Jet

In a Forrester Research study of over 1000 people, they found that 40% of people will abandon an e-commerce site if it takes longer than 3 seconds to load. Whilst these figures vary with other types of site, as people are less bothered about waiting for video content etc, but on the whole, your website should load pretty darn quickly unless it’s worth the visitor’s time waiting. And don’t just think ‘well our products and services are great so people are bound to wait’, I’m sure you have plenty of competitors out there, so your visitor will happily navigate to one of their faster loading sites if yours under-performs.

There are two places you can speed up your website – on the server-side and on the client-side, and there is masses you can do on both accounts, so I won’t go on for too long, here are just a few things to think about.

Server-side

  1. Is your server local to your visitors? Generally the further away it is, the lower the ping. Many web design companies in the UK use hosts in the states because they are generally cheaper, but it’s often worth that bit extra for a UK host. This is also why Content Delivery Networks or CDNs (such as Akamai) are taking off as they cache media files on servers close to the visitor.
  2. How long is it taking to generate pages – from an incoming request to the outbound data? You should look to minimise this. Again, switching to a more powerful hosting setup can often be a quick fix, especially if you are on a crowded shared hosting environment.
  3. Is there anything you can off-load to an additional request? With AJAX becoming ever so popular, you can leave out the parts of your site that take a while to load and use a second request over AJAX to pull them in, that way the user isn’t sat in front of a white screen for ages. Github.com does this very well for their repository statistics.

Client-side

  1. How many different HTTP requests are you making? I know this sounds contradictory to the previous point, but each request has a small amount of overhead, especially if it has to load from a different domain. This is why people group images into sprites because one big request is much faster than 10 smaller ones. Also note that some browsers only allow downloading of 2 images at a time, and a request for javascript will prevent loading of any other requests until they are complete, that’s why people use asset hosts that point to the same domain.
  2. How many effects and generally large quantities of JavaScript are you using? It’s easy to run away with adding hundreds of cool effects to websites to wow clients, but remember web designers: we use awesome browsers like Safari and Google Chrome – a large proportion of the web are using Internet Explorer which is so slow – don’t grind everyone’s browser to a halt by running everything on page load.
  3. Finally (and this should be obvious to web designers), please don’t use inline JavaScript or CSS, it will be downloaded each request, whereas linking to external files allows the data to be cached by the browser, so subsequent requests are much faster. As a bonus point you can also then easily minify and gzip these files to ensure they are as small as possible.

A tool like the Safari Inspector or YSlow! and Firebug for Firefox can help with analysing the client side loading times of websites. Even if you are a website owner, you can still check out these tools to see how your website performs against others.

Image Credit: F-22 Raptor @ Flickr