9 Ways on How to Improve Website Loading Speed

Tired of a slow website? Learn how to fix and improve your website’s performance to get faster page load speeds, happier viewers, & better conversion rates.

How to fix a slow loading website

Your site could be leaking users. You've spent a lot of time working on usability and user experience, however people are still not staying on your site long.

This could mean that your site is too slow. One of the main things that will turn people off about a website is slow loading time. Slow page load speed can drive people away faster than…. well at least faster than the time it takes for the page to load!

QUICK NOTE: Studies have shown it takes ONE second for a viewer's flow of thought to stay uninterrupted. Every second after, your website is at risk of losing that viewer's interest. Your goal is to get your website to load one second or less.

Despite the fact that we can get things faster now than any other time in existence; we barely even need to get off the couch for what we want. But it's never enough. We want what we want and we want it now.

The Speed of Your Website is Important!

In the early days of the web, many websites were static HTML, so theoretically they would take very little time to load. However, connection speeds were also low. (If you're too young to remember browsing the web on a 28.8 modem, compared to a typical cable connection of 2MBs, this is like being forced to drive about 1 mile per hour on the highway). It was very important to consider image size and number of graphics on a page, not to mention that dynamic websites were loaded using CGI; which slowed down things considerably. Now, bandwidth has increased. We can do a lot more on the web, and of course, we do.

However, it's important to remember that the old rules still apply. The average web user's patience for the time it takes has decreased in an inverse relationship to website speed. Our patience with waiting has decreased with new expectations. People want things instantly.

ALSO READ: Speed also matters for SEO.

Testing Tools

Before you start anything, you will need to have a method of determining what is slowing your site down and a benchmark of your current website speed to measure improvements. The problems listed below may or may not be your chief issue, but you will have no way of knowing unless you can monitor the process.

You should be aware that there are a lot of gives and takes. Some of the solutions below may sound like they contradict each other. That is because sometimes the solution to one problem may increase a speed problem down in another aspect of your site. For example, creating image sprites could cause the need to load one large image at first, which, while reducing the need to load many other images, could slow initial load time (I will go into these methods more later).

For this reason you should be measuring the results of one change versus another so you can determine what gives the best results.

Here are a few useful tools:

  • Google Page Speed Insights – This free tool from Google will check any URL and run a test on your site for its performance. It provides different results for how your site works on both desktop and for mobile platforms. It will cover many of the areas discussed in this article and give suggestions for individual about what might specifically be causing your site to slow down.
  • Yslow – This is a free plugin for your browser that will provide you with a grade based on the number of HTTP requests, image sizes, whether a CDN is being used, etc.
  • Pingdom Website Speed Test – Pingdom also has some great speed testing solutions, which can test your site from multiple locations around the globe (this is one of the reasons why it's a good idea to use a CDN; more on this below).
  • Performance Budget Calculator – This is a helpful little tool for figuring out what sort of content you can “afford” (based on bandwidth) to keep your site running optimally.

CAVEAT: Another important thing to take into mind is which approach best improves the user's experience. You should find out whether additional load times versus gradual load times are most effective. The best way to do this is with usability testing and specifically A/B testing.

How to Make Your Website Load Faster

Okay, so now you have some testing tools. First, let's look at your site itself:

DO YOU USE WORDPRESS? There are many plugins available to do a lot of the tasks listed here! Check out our article exclusively meant for making WordPress faster.

1. Your Files are Too BIG or You Have Too Many

Remember earlier how we talked about how important file size was in the early days of the web? It's still important. While this may seem obvious, it still needs to be said. Large files take longer to load.

Use smaller files and fewer of them (also this might actually increase user experience. While people do like images, too many can create information overload)

Most of the time, you don't need very large images. While it is easy to resize an image using CSS, if you are doing this to make a file smaller, then you are wasting bandwidth. Resize your images before you upload them. It's amazing how much smaller you can make them.

2. Turn on GZIP Compressing

Even after you've reduced your file size, it's a good idea to compress them, along with the rest of your site before sending it to the user. You are likely already familiar with this concept. Sometimes you need a way to send a lot of files over a network, so you've needed to “zip” them up to be a size that will be allowed by your provider. Well, HTTP compression is pretty much the same thing.

Most web servers will allow compressing files with a utility called gzip. Gzip will take all of the files on your site, compress them into a much smaller size before sending to the user's browser. This will work with all of the files on your site. Here are also some other handy online compression tools available for you to compress the files on your site.

3. Caching

You can also give instruction to browsers about when it should use a cached version of your site versus a new version. By using Expire Headers you can tell the user to use cached content if it is static, but also leverage when in needs to load new content, such as with dynamic content.

4. You Have Too Many Server Calls (HTTP Requests)

This is one of the most important things to consider when speeding up your site. Every time you request a new file, or redirect the site for any reason, this slows down the process. With each one, the user's browser must take the trip to your server, which will then find the resource, and pass it back through to the user. While this is okay in small doses, each server call (especially if they are happening on the same page) will slow down your site drastically.

Every single file you request or have on your site sends a call to the server. If you have 20 images on your site, that's 20 times the server has to be called. There are a number of things you can do to reduce these.

  • Use CSS image sprites – these are single images which include a composite of all of the images on your site as one image. You can use CSS to provide only the part of the file that is necessary to be shown in a specific location. This means that instead of 20 calls for 20 images, it will call only one large image. However, be wary – while this reduces number of calls to the db which will definitely speed up your site, image size can still be an issue.
  • Fix your broken links – every time you try to send someone to a page that no longer exists on your site, it causes your server to deliver a 404 page. Essentially this means that it looks for the page, gets a not found message, and then must retrieve a custom error. Each one of these server calls can slow you down.
  • Reduce redirects – try to reduce the amount of times you choose to have your server to send someone to a different page. While this may seem helpful (for example, for SEO) to have pages set up for this purpose, if you make too many server calls, this can slow your site down and negatively impact user experience.
Example of an Image Sprite
An example of an Image Sprite. Image Source

6. Your Website's Coding Needs Optimization

  • Minify your CSS and your javascript – Blank space means something to the web browser. It may look empty to you or me, but each blank space is a character which must be read and rendered. In many cases it is not necessary, so you use some minimizing tools to compress these files into still working but faster to read components. Google has some good tools available to help you minimize your JavaScript and your CSS
  • Use HTML instead of PHP if it's not dynamic content – While much of your code may be dynamic, sometimes it's fine to go old-school and just use plain HTML code. PHP must be run through a processor. HTML is interpreted directly by the browser. If it's just static content you are delivering, then store it statically.
  • Put your CSS at the top and JavaScript at the bottom – This is an old rule, but it still applies. You need the CSS to be rendered quickly, but JavaScript should only be run after the page itself loads. Also you may wish to not depend too much on calling JavaScript from an external file. If there's not a lot of it, include it directly on the page, as this is one less HTTP request that needs to be made.

Note: If you are using large popular JavaScript libraries, such as JQuery, the advice is a little different. You will want these in a separate file, but realistically it's an even better idea to use the jQuery directly from a CDN. This has a couple of advantages. Because these libraries are popular, there's a very high likelihood that the user already has a cached version of this library, so loading it takes no time at all. If you have your server provide it, this is another server call, and the entire library will be need to be loaded for it to work. This can add to your website's slowness.

Okay, so now you've looked over and fixed as much as you can internally, but it still seems slow, especially from long distances. Let's look at some server tools.

7. Your Site is Slow Because of Latency

Latency is a term which refers to the amount of time it takes for your server to respond to an HTTP request. The reason this is important for the same reason that you don't want to make too many requests. If you can speed up this time, it will drastically increase the speed of your site. Latency increases as a function of the physical distance between the end-user and the server providing the content.

Website latency example

One of the best ways of handling this is by using Content Delivery Networks, or CDNs. These cache copies of your website content at various places on the globe, so that latency is decreased for each of those locations. The most well known CDN providers include Akamai, Cloudflare, and Amazon AWS, but there are many others. Researching using a CDN is well worth your while, especially if you have customers that are far from your server's location.

8. Your Web Hosting Provider is Just Not Fast Enough

No matter how much fiddling you do with your graphics and everything else on your site, it will only be as fast as its weakest link – which in this case, is your web server. Choosing a fast web host is a crucial factor for a fast website. While it's a good idea to clean up all that you can first, you should also examine the specifications of your site and see whether or not it can handle the capacity you need. You will need to figure out how much bandwidth you need to produce the performance you desire.

9. Your Database is Too Slow

Most websites today rely heavily on content which is stored in a database. This is especially true for eCommerce sites. You likely have many products and need to store them and provide them with a click. While databases are great and are your friend, the database could be inefficiently organized, or there could be a number of bad queries. Remember, if a user has to wait several seconds between each query, this adds up. If users don't find the exact product they want right away, or if it takes too long, they may leave without a purchase. Even if they do find something, the odds that they will continue browsing will also decrease with every second extra it takes.

Here's a good step by step guide on how to get started with this on a MySQL database.

Note: If you have a large database, you may need to hire a database professional to assist you, as this can get somewhat involved.

Conclusion

While each of the above-mentioned categories can be delved into in much greater detail, if you follow these guidelines, you stand a very good chance of cutting your website load time in half or more, and you most certainly will improve the speed of your site. Please let me know in the comments section if you have any questions.

About the author


  • Jason Simon is a Web Developer and Usability expert who has been creating websites for over twenty years. He holds a Masters in Library and Information Science, and consults businesses, non-profit organizations, and educational institutions in organizing and converting complex data into clear and easy-to-understand information.

ADD A comment


Leave a Reply