If you’ve spent any time in the digital industry, then you know just how important page speed is when it comes to great user experience. Its importance really was first emphasized back in 2010, when Google announced that page speed would become a major ranking factor for search. They weren’t very specific about actual page speed, but the experts at the company did say that page owners need to aim under less than half a second when it comes to loading speeds.

Even today, this target might seem a bit over the top for newcomers, however, there are different ways for optimizing website speed. One of these tactics is improving latency.

In this blog post, we will talk about the topic of latency and we will give you a few tips on how to use it to work in your favor.

What is latency actually?

Simply put, latency is the delay that happens when the browser sends the request to the server and that same server is processing the sent request, In best cases, it’s only measured in milliseconds.

However, it can be measured in two different ways. The first is the RTT or round trip time, which is the amount of time it actually takes the request to make it to the server and back again. The second method is the TTFB or time to the first-byte method, which measures the amount of time it takes the browser to send the request and to receive the first data bytes from the server.

In most cases, the main culprit behind latency is distance. Simply put, the longer the distance between the request and response, the more time it will take the data to travel back. For instance, US site visitors will get a more rapid response from US-based data center locations than European visitors of the same site.

Good vs Bad Latency

Needless to say, good latency would be zero in an ideal world. However, because the request takes time to process and complete, it can’t be that low, but needs to be as close as it possibly can.

Putting it the simplest way, you can’t really differentiate between good and bad latency because they are both relative terms. As a rule of thumb, experts will say that anything less than 100 milliseconds is acceptable. Above that, you might need to improve your latency, however, the optimal range is still significantly lower, or between 20 and 40 milliseconds.

The problem is, you can’t eliminate latency. However, you can minimize it, and there are several ways to do that.

Reducing (Improving) Latency

Please note, that below, we are only focusing on server-side solutions.

website performance on a laptop screen
Image Source: Unsplash

 

Using a CDN

Because latency is basically browser-server distance, you can simply reduce that distance by bringing them closer to each other. And while you can’t do this in a physical sense, you can always use a CDN or a content delivery network.

This network is a distributed system of servers that’s sole purpose is to deliver web content as fast as possible no matter where they are visiting from. With such a system, you don’t need to wait on the server to send the content to the rest of the world because the CDN will be able to tap different servers across the globe that are the closest to the visitor and deliver the requested data as quickly as possible.

Once the server that’s closest to your visitor delivers and shows the requested data, that server copies those assets and when another visitor from that same part of the world tries to open that same content the CDN will redirect their request to the closest server and give the already cached content.

You can purchase CDN services from vendors or actually you can get it built-in to your website.

Compressing Website Images

Optimizing the images on your website is a rather old and reliable way to improve site speed and/or to reduce your site’s HTTP requests. To do this, the image files on your website should be smaller than 100KB. By any means, don’t go that far if it’s affecting the quality of the image, but go as close to 100KB as you can.

Also, you can compress your images, resize them, and even upload smaller images by default using different tools.

Downsize JS and CSS Files

The vast majority of pages of the web will have a combination of CSS, HTML, and Javascript. The only problem with this is that whenever a user loads a page, the JS and CSS files need to be sent from the server to the browser. This leads to more HTTP requests, that in turn, could do a number on your latency time. You can’t remove the JS and CSS from your pages, but you can minimize the file sizes. The smaller the files are the faster they will travel and the better the latency figures will become.

You can minify your files using Google’s Closure Compiler Service.

Less Render-blocking Resources

When you load a page, browsers parse and download resources (images, CSS, and more), then they render them to the visitor. Some resources, like JavaScript files and some fonts, are prioritized by the browser. This means that until these are processed, other parts of the page are stopped parsing and downloading.

These fonts and JS files are what experts call “render-blocking resources”. They can significantly slow down your website, and reducing their numbers won’t technically improve your latency, but it will create a perception of a way better load time on your site.


Putting it Together

As you can see, latency plays an important role in website performance. Minimizing latency can ensure that your visitors get the requested data as fast as possible. Speed is one of the keys to a seamless user experience and improving latency is a good way to boost your website performance.

Szabolcs Szecsei

Szabolcs Szecsei born on February 4th, 1989, A Hungarian writer, living in Novi Sad, Serbia. With a master’s degree in Communication and Media Studies, Szabolcs has been working in the news and marketing industry for more than six years. Apart from writing, Szabolcs is also a professional touring and recording musician, working for several bands and projects.