A Beginner’s Guide to HTTP/2 and its Importance

Everyone understands the importance of improving the speed of your website, and HTTP/2 provides a great opportunity to do exactly that. As a relatively new opportunity, it is a great way to beat your competition and start improving the experience of your users today.

If you’re new to HTTP/2, don’t worry. We will run through what HTTP/2 is and how it allows web pages to load far more quickly in comparison to those using HTTP/1.1. It’s one of the biggest changes to the Internet made to date, and should be of interest to anyone concerned with user experience.

What is HTTP/2?

HTTP/2 is the latest version of HTTP (Hypertext Transport Protocol), the underlying protocol used by the World Wide Web, which defines:

  • How information is transferred from one computer to another
  • How messages are formatted and transmitted
  • What actions web servers and browsers should take in response to various commands

In layman terms, HTTP is how websites are delivered to your computer, and the next version of it is about to make it much faster. More detail on the basic of the HTTP protocol can be seen in this short video.

What problem is it trying to solve?

In order to understand the importance of HTTP/2, we must first understand the problems it is trying to solve.

The most common transfer protocol on the web is HTTP/1.1 which was standardized back in 1999. The web back then was very different, with slower web pages and slower internet connections. But over the years, the way that we use the web has changed significantly and websites are now much more complex than they used to be.

Therefore, they are more demanding of the web infrastructure and the old HTTP protocol, which has lots of limitations and is becoming outdated. For this reason, we expect to see the “pipes” of the web being upgraded from HTTP/1.x to HTTP/2 over the coming years.

The aim of this transition is to ensure the web infrastructure that we are becoming ever more reliant on is robust enough to handle ever increasing amounts of data. It is the digital equivalent of moving from an A road to driving on a motorway.

To see the kind of speed increase that is possible, take a look at this video, which demonstrates in 5 seconds how a webpage loads faster in SPDY, the protocol that HTTP/2 is based on.

If you are not convinced yet of the differences in page load time, have a look at this study published by HttpWatch, which analyses and compares speed performance of HTTPS, SPDY and HTTP/2 and demonstrates how transfer speeds can increase up to a 20% with HTTP/2.

How is page speed improved?

Multiplexing

One of the limitations of HTTP/1.1 is that it is only able to request files one by one on a single connection – this means requesting the file, waiting for a response, downloading the file and then requesting the next one.

This process can significantly increase page load time, especially for pages with a high number of requests. As illustrated in the image below, HTTP/2 changes how requests and responses travel between browser and server by “multiplexing” multiple files over one single connection.

http-2-multiplexing
Source: CloudFlare

Header Compression

HTTP/1.1 requests and responses are transmitted in plain text (causing a lot of unnecessary bytes being downloaded) but with HTTP/2, each bit of information is compressed and transmitted in binary code, making it more compact and efficient which avoids the user’s computer to wasting time translating the information into a format it understands.

This means that the overhead of each request will be smaller than the uncompressed HTTP/1.1 equivalent, saving significant bandwidth in some user sessions. Page load speed is critical upon mobile users, where the benefits of this feature become even more important.

Server Push

With HTTP 1.1, when your browser connects to a web server requesting a web page, the file’s HTML is sent first and then your browser asks for the JavaScript files, images, CSS, etc. (which means a lot of connections turning on and off and slowing down the rendering of the page).

With HTTP/2, the server will know what content the browser needs in order to render the page and will be able to supply – or “push” – this data to the web browser before it actually requests it, saving a lot of time.

SEO benefits and drawbacks

Benefits of HTTP/2:

The benefits of moving over to HTTP/2 are immediate as over 75% of UK users are using browser that can take advantage of the protocol, a figure only set to rise.

  • Faster Load Times: HTTP/2 promises to be faster than the current standard as it removes many impediments of the protocol.
  • More Secure: Because HTTP/2 will have encryption on by default, security across sites using the protocol will be increased.
  • Mobile friendly: The header compression feature allows mobile sites with high amount of requests to prevent wasted megabytes from the headers from being downloaded.
  • Less dependency on hacks: Thanks to the multiplexing feature, high time consuming methods to reducing the number of requests from the server – like domain sharding, image sprites or in-lining Javascript and CSS – won’t be as indispensable.
  • HTTP/1.1 Compatibility: To ensure that the switch to the new protocol is as smooth as possible, servers and browsers which remain only HTTP/1.1 compatible will still be able to communicate with HTTP/2 servers/browsers (both parties will have the ability to decide which version of the protocol will be using to communicate with each other, as illustrated in the image below).
servers
Source: NGINX

Drawbacks of HTTP/2:

Nonetheless, there are also some limitations businesses should take into account before switching to the new protocol.

  • Be aware of your audience: Although 75% of UK users are using browsers than can take advantage of the protocol, a number of people continue to use older browsers which don’t. Additionally, not all web servers out there support HTTP/2. Therefore, current page speed optimisation techniques will remain necessary.
  • HTTPS Prerequisite: Switching from HTTP/1.1 will be more difficult if a site isn’t already using HTTPS, since HTTP/2 has the prerequisite of the site already being on HTTPS. Migrating a website to HTTPS will need some work, requiring all HTTP URLs to be redirected to the HTTPS secure version of the protocol. However, HTTPS is a positive ranking factor for Google and, since security is a top priority for the search engine, we expect them to apply more weight to this signal in the future. Therefore, it would be a good idea to upgrade your site as and when you can.
  • Performance impact could be minimal: Switching from HTTP/1.1 to HTTP/2 could take a lot of time and resources so it’s important to be sure that the impact in site speed worth it. If a website is already well-optimised for speed, the performance improvements might be smaller than expected.
  • HTTP/2 Unknowns: The protocol is still relatively new; a lot of studies will have to be conducted in order to determine best practices and possible pitfalls.

Implementation Process

Every protocol, including HTTP/2, works like a spoken language: for the communication to be effective, both the sender and receiver (in this case, the web browser and web server) need to speak the same language.

HTTP/2 is designed to improve current HTTP standards, not replace them entirely. Therefore, the current guidelines on how web elements (such as URLs, HTML markup, redirects, 404 pages, etc.) work remain the same and are just used more efficiently.

The process for upgrading from HTTP1.x to HTTP.2 has four steps:

1Step 1: Make sure your website is using HTTPS

HTTP/2 has the prerequisite of the website being already in HTTPs, but it is important to note that HTTP/2 requires an improved version of the transport layer security (TLS1.2), which was standardised in 2008; it offers better security than previous versions and should already be used by the majority of services.

2Step 2: Check if your visitors’ browsers support HTTP/2

Most of the modern browsers across both desktop and mobile already support HTTP/2. However, we recommend you find out in Google Analytics what browsers your visitors are using and check them against this list of browsers that support HTTP/2.

3Step 3: Update and configure your server software or infrastructure to support HTTP/2

First you will need to verify whether your web server already supports HTTP/2; if it already does, you won’t need to do anything; if it doesn’t, you will need to upgrade the version of your server or switch to one that does.

Because there might be still users using older browsers, we recommend you use a server that supports both HTTP/1.1 and HTTP/2. This way, people using newer browsers will communicate with your server using HTTP/2, whereas older browsers will continue using HTTP/1.1 connections.

Apache and Nginx are the most commonly used servers in the web (both together serve traffic for 66% of all active web servers) and both of them support HTTP/2 so it is quite likely that your website’s server can support HTTP/2 already.

Nginx supports HTTP/2 natively; Apache, however, supports it via the mod_spdy module. In addition to this, IIS running on Windows 10 or Windows Server 2016 is also compatible with HTTP/2.

As IIS explain in this article, there are no new IIS configuration settings specific to HTTP/2 so if you are using one of these servers, you shouldn’t need to change anything in your application for HTTP/2 to work.

On the other hand, if you aren’t using any of these, you can also place a reverse proxy that supports HTTP/2 (like HAProxy) in front of your existing web server.

4Step 4: Continue to optimize your website speed as usual

Just because you’re now using the new protocol doesn’t mean your optimisation journey is over. Current site optimisation techniques – like image optimisation, inline styling or JavaScript parsing – can have a big effect on your site’s performance and will still be needed. Even if you implement HTTP/2, make sure you are following best practices for site speed performance.

Final thoughts

As search engines and consumers constantly demand faster experiences, the opportunity of HTTP/2 should be of great interest to brands looking to gain competitive advantage. It’s one of the biggest changes to the Internet to date, and now is the right time to start evaluating whether this is right for your business.

Googlebot does not currently request URLs over the HTTP/2 protocol itself yet, but you don’t need to wait to start getting the advantage. Pages will load faster for your users, which makes them happy, and through search engines leveraging user signals, this will lead to improved SEO performance.

Note: The opinions expressed in this article are the views of the author, and not necessarily the views of Caphyon, its staff, or its partners.

Author: Maria Fores

Maria is a Senior SEO Executive at Ecselis, London. She has over three years’ experience in SEO and works across technology, automotive, aviation, education and property verticals. She is passionate about optimising websites to make them as fast as possible.

5 thoughts on “A Beginner’s Guide to HTTP/2 and its Importance”

  1. Hi Maria,

    I read this article with great interest and I’m curious what your thoughts are about site speed improvements via http/2 vs. AMP (Accelerated Mobile Pages by Google, which seem to be increasing in ubiquity) vs. PWAs (Progressive Web Apps) – both of these seem to offer webmasters a similar but confusing set of choices when it comes to increasing site speed and improving user experience.

    Also – I’d read on the NGINX blog that moving to http/2 might also require rolling back certain optimizations designed for improving page load on http/1.1 made to be a hindrance on http/2 due to it’s multiplexing capability over 1.1 – do you have any comment about that?

  2. starting from Chrome build 51 users will be falled back to HTTP/1.1 for all the sites not served by Ubuntu 16.06 that is the only OS currently supporting ALPN (Chrome doens’t support NPN anymore only ALPN is working) . In few words all people using chrome can continue to visualize http/2 enabled sites ONLY if they change their browser (what???) ( at list until all OS will be updated t recent OpenSSL version)

    so guys do not expect too much improvement for next short term coming from this great http/2

  3. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting….

  4. Your diagram is factually incorrect. HTTP 1.1 by default uses persistent connections (keep-alives) so you don’t have 3 separate TCP connections (i.e. one per resource) but rather 3 separate HTTP requests, one for each resource over the same single TCP connection.

    Each HTTP request incurs overhead because it’s back and forth, HTTP/2 enhances this by sending all dependent resources in a single shot as delineated binary data.

Leave a Reply

Your email address will not be published. Required fields are marked *