How Switching to HTTP/2 can Increase Site Speed

By Robert Taylor

Configuring your website to load quickly is becoming increasingly important to help visitors find your site, visit it, stay on it, and want to return to it. More and more users are browsing the web with mobile devices, and as technology becomes cheaper, moderate and entry level smartphones are being snatched up at a lower price point. Mobile devices don’t have the same processing power as a desktop computer, so it’s important to keep this in mind while creating a flashy site.

In order to do this, a website needs to be optimized for speed, as site speed is an important ranking factor of Search Engine Optimization. This appeases both Google’s ranking factors and user experience. There are many reasons why websites do not load quickly but some of the most difficult to address are latency, and pages with a significant number of resources required to load the page.

Why Latency is an Issue

To get a page resource (CSS, JS, image, etc), a request is sent to the server and then server provides the file to the client. The measure of time between sending and receiving requests between computer and server is called latency.

A few things that affect the transfer time of a request include:

  • Distance between client and server
  • DNS lookup time
  • Connection establishment time
  • SSL handshake (if using https)

In this example, you can see the amount of time it takes to set up the initial connection and download the content from the server:

  • DNS – looking up domain information – 168ms
  • Connect – time it takes to create connection – 248ms
  • SSL – handshake to establish secure connection – 258ms
  • Time to first byte (TTFB) & Download – 255ms

Total connection set up time – 674ms, total download time – 255ms.

But how does this relate to latency? Well, imagine a website having 100+ requests in order to get everything needed to fully build the webpage. Each request requires several back and forth trips, increasing the connection set up time substantially.

A tactic to reduce response time from servers would be utilizing a content delivery network (CDN). Instead of having all your assets in a single location, using a CDN allows them to be stored in various locations throughout the world, delivering assets from clients that are physically closest.

Too Many Requests Hurt Performance on HTTP1.1

Another limitation with HTTP1.1 is that only 6 connections can be opened at a time per host. Therefore, if you have a site with many resources coming from the same server, each transfer must complete before a new one can start.

This waiting game can quickly add up to wasted time, and frustrated users.

A huge benefit of HTTP/2 is that there is no limit of concurrent transfers due to multiplexing of streams over a single TCP connection.

Compare these timelines. In the HTTP1.1 example, about 18 resources are downloaded at the 4 second mark, compared to HTTP/2, below, where every single one is completed before 1.5 seconds.

 

Speed Up Your Website Today

Sick of long loading times? Visitors to your site bouncing or not viewing enough pages? Wanting more conversions?

Get in contact with Advantix Digital today and let us assist in increasing the speed of your website.