Is your website slower than a snail covered in glue? Here’s why your site might be struggling – and what you can do to fix it.
It’s hard enough attracting visitors to your website, without losing them because of slow-loading pages. Poor web performance deters users, reduces sales and damages your reputation. Of course, it works the other way too – optimising your website can drastically improve visits, sales and conversions.
The reasons for a website moving slowly are varied, but chances are your problem will be related to the images on your site, the code it’s built with, or your servers.
Image issues
Big image files on your site could definitely be the culprit.
The easiest way to find out if your images are slowing you down is by putting your site through a Web Speed Test, which will identify problem images and give your site an efficiency score.
If you’re using huge image files for tiny thumbnails, you could crop the images to size so they’re a better fit for the element. Or compress your images to get the file size down.
‘If you’re using an image file for a page heading, why not swap it out for styled copy? Text takes up less space and it’s more accessible too.’
Some image file types are bigger than others, but there’s no ‘one size fits all’ rule for which file types are better to use. It depends what’s on the image itself, whether it’s a logo or not, and if it’s transparent or not.
Follow this guide to find out how to choose the most appropriate file type in each case.
A good general principle is to use images sparingly. If you’re using an image file for a page heading, why not swap it out for styled copy? Text takes up less space and it’s more accessible too.
Don’t forget your fonts
Having too many web fonts on your site will slow you down (and probably look like a design disaster too!). While the page is loading, your text might not appear at all – which won’t impress your visitors.
Keep your fonts to a minimum for a fast, stylish website.
Code complications
You should definitely employ browser caching on your site.
When somebody visits your site for the first time, the browser will temporarily save larger files on that visitor’s device. When they next visit, the site will load faster because it will access the cache (and won’t have to load everything from scratch again).
Minify your CSS and Javascript to speed up your load time. Human beings need spaces and longer names to understand what the code is about – but browsers don’t. Minifying removes all the spaces and renames items so your code is as compact and efficient as possible.
‘Be selective about what JavaScript elements you use and be smart about the way you load them.’
Check to make sure your server has Gzip configured. Gzip compresses everything your server sends by converting text to binary, which takes up less space.
Analytics tags on pages, social sharing buttons and ads all rely on external JavaScript to run. Be selective about what JavaScript you use and be smart about the way you load them.
You can set your JavaScript up to load asynchronously so that elements that take longer to load do so in the background (and don’t hold everything else up). This will minimise the impact those external elements can have.
Server pains
Most basic server packages host your site on servers with loads of other sites. Which can work great if you don’t have a ton of traffic and want a cheap deal. But if your visitors are increasing and your load speed is slowing, it could be because your web host is overloading the servers.
If you’re sharing hosting with a site running a lot of code, that’s going to slow you down – through no fault of your own. It may be worth a switch to a dedicated server to ensure you always have the space you need to grow.
If it’s your site that’s getting too much traffic to handle, the same principle stands – getting a dedicated server that’s big enough to deal with the volume will help you scale up gracefully.
You also need to ensure your servers are as close as possible to your target audience. If your servers are physically too far away from the bulk of your site visitors, there are going to be delays. It makes no sense to have your server in the US if your customers are in the UK, for example.
‘How you structure your queries will impact your database performance – optimising your queries will make them execute faster.’
If your audience is international, consider using a content delivery network (CDN). A CDN is a system of servers that deliver customised web content to users based on their location. CDNs are very effective at speeding the delivery of websites with high traffic and a global reach, and have the added benefit of protecting you from unexpected increases in traffic.
If your website works with a database, making queries to it will increase the page load time. How you structure your queries will impact your database performance – optimising your queries will make them execute faster.
New Relic can help you spot issues and bottlenecks that are slowing you down – think of it as Google Analytics for your back end.
Even if your queries are optimised, heavy load and usage can make loading slow. You may want to implement a database caching strategy (such as Redis or Memcached) – when you make a query to the database, every subsequent query made will be much faster because that query will be stored in memory.
You won’t need to worry about the cache becoming outdated because the memory is flushed when tables are updated with new information. And another benefit of caching is that fewer and fewer requests will be made to your database, taking the load off and making other queries faster.
Still slow?
This guide provides an overview of common issues but there are many factors that can affect a website’s speed. Get in touch today for specialist support in optimising your website.
You could also put your questions to our panel of experts at Design/Build/Market: Performance Matters, on the 23rd October at The Engine Shed, Bristol.
Join us for an evening of talks from professionals in the fields of design, development and marketing, and explore performance optimisation techniques that can have a big impact on your business.