All You Need to Know About HTTP 2


In 2015, a new version of the HTTP network protocol — HTTP/2 was approved. Now, it is becoming more and more popular: the protocol already supports the Apache and Nginx web servers, Chrome, Firefox, Opera, Edge, and Safari browsers, as well as the mobile devices. The number of HTTP 2 services and sites is constantly growing. In the near future, the Internet is waiting for the transition to a new protocol, which accelerates the website download. Let’s find out how this will affect the site building, SEO, and other aspects.

What is HTTP/2?


The HTTP/1.1 protocol has been used since 1999 and over time has acquired one significant problem. Modern sites, in contrast to what was popular in 1999, use a lot of different elements: JavaScript scripts, CSS styles, and sometimes also flash animation. When you transfer all of them, the browser and the server create several connections.http 2


The HTTP/2 protocol significantly speeds up the websites speed due to the following features:

  • Connections: multiple requests can be sent via a single TCP connection, and responses can be received in any order. There is no need to keep multiple TCP connections.
  • Thread priorities: the client can set the server priorities — what kind of resources are more important to him than others.
  • Header compression: the size of the HTTP header can be reduced.
  • Push-sending the data from the server side: the server can send to the client the data that has not yet requested, for example, based on data about the next page the users are going to open.


The HTTP 2 protocol development was based on SPDY protocol, developed by Google. But Google has already announced that it will refuse the further SPDY support to a more promising HTTP/2.

Difference between HTTP and HTTP 2

The changes which have been made to the first protocol do not require much of alterations in the way the applications work. Although, there is an advantage for new applications which will work on enhanced speed. The key differences between the two protocols have been listed below:


  1. The high-level syntax of both the protocols is the same. As already mentioned, the status codes, header fields, and URIs are the same. The modified element is the framing of the data and how it is transported between the server and the client.
  2. HTTP/2 allows responding to more queries which have been given by the client according to the data. This also enables the server to provide the data which is utilized by the browser to render a webpage. This is done without the requirement from the browser to examine the first response and without requesting for an additional overhead cycle.
  3. Efficient websites minimize the number of requests which are required to render a particular page. This means that the code is rendered into small packets carrying codes in them. This does not reduce the functionality but neither does it bring any convenience or efficiency for the browser.
  4. There was a head-of-line blocking problem in HTTP 1 which was overcome in the next protocol. This was done in HTTP/2 by multiplexing the responses and requests. Also, it helps in header compression and prioritization of requests.


Below is a good visual representation of the basic difference between HTTP/1 and HTTP/2 (courtesy : )

nginx http/2

Drawback for HTTP/2

This protocol has faced a lot of criticism because of its development process:


  1. The protocol is said to be inconsistent and carries with itself unnecessary and overwhelming complexities.
  2. It duplicates the flow control which violates the principle of protocol layering.
  3. There are HTTP applications which do not require any encryption but it comes with heavy encryption costs. People have no desire to spend additional resources but they are made to do so.
  4. It is stated that the present model certificate is not compatible with small devices like routers because annual enrollment and a non-trivial fee is involved in it.
  5. It has also been criticized for not supporting opportunistic encryption which is a strong measure against the passive monitoring. It is being considered mandatory that passive monitoring must be considered as an attack.


Why did the world need HTTP/2?

nginx http/2

The first description of the HyperText Transfer Protocol (HTTP) protocol was published in 1991. The new version, HTTP 1.1, was approved in 1999. It is supported and used up to now. However, for 17 years, the website sizes have grown significantly — about 1.9 MB of data is transferred to download one page.


HTTP/1.1 does not cope with the load. The protocol limits the number of simultaneous connections, and the pages load the content slowly. To speed things up, you can optimize the website load: connect CDN, configure caching, merge several elements into one, remove optional characters from JavaScript and CSS styles, distribute the site to different hosts, etc. Some techniques are effective, but somehow just offer a temporary solution.


The cardinal solution to the problem — improving the protocol — was engaged by Google engineers back in 2009. They did a lot of optimization work and created the SPDY protocol. It really speeds up the websites, the protocol is supported by almost all browsers, but it also requires server-side support. However, there are modules just for Apache and Nginx.


The new HTTP 2 is based on SPDY. However, it is backward compatible with HTTP/1.1. There is no need right now to upgrade the site to a new protocol. For some time, it will work on the old one, just a bit slower.

Is HTTP/2 really faster?

HttpWatch Experts performed several tests and found a serious acceleration with HTTP 2.


The screenshot below shows the download speed of the page using HTTP / 1.1:

http 2 ss1

And on this screenshot — the result of using HTTP  2:

http 2 ss2

Download speed increased by 23%. HttpWatch experts also note that the technology is not yet fully optimized, and expect a real acceleration of up to 30%.

Why HTTP/2 works faster

Multiple requests are sent within the same connection. In HTTP 1.1, a separate TCP connection is established for each text, styles or images request, and the number of simultaneous TCP connections is limited. Because of this, pages with more static content are loaded slower. When using HTTP/2, the browser performs several queries within the same connection — this is called multiplexing. Static elements are loaded parallelly, and the website speed grows.


Service HTTP headers are compressed. The web page consists of images, JavaScript, CSS styles and other elements. In the loading request, the browser sends the HTTP service headers, and the server returns them — the operation takes up the additional resources. In HTTP/2, headers are compressed. So, the amount of data between the server and the browser is reduced —additional resources are free.


Increased security. For HTTP 2, encryption is not necessary, but trendsetters among browsers — Google Chrome and Mozilla Firefox — have added the HTTP/2 protocol support only for encrypted connections. If you are thinking about switching to HTTP/2, first use the HTTPS on your website. As a bonus, you will get a better position in the Google organic search and use all the HTML5 capabilities.


The prioritization order changes. In HTTP/1.1, you are able to assign priority based on dependencies. The browser asks the server to download the specified content first. For example, the server first gives CSS or JavaScript files, and then HTML or images. In HTTP/2, prioritization is a desirable method. If you do not configure it, multiplexing will not work properly. Resources that can be loaded later, will take a separate strip and a part of the power. This will lead to the speed reduced.

Why is it important to speed up the website pages loading?

John Muller, the Google Webmaster Trends team analyst, wrote in his blog that the HTTP 2 support is not a direct ranking factor in Google. At the same time, download speed is a significant ranking factor, so it makes sense to use HTTP/2 for SEO-promotion.


He added that the website acceleration should positively influence the ranking due to behavioral factors. A faster page has a lower failure rate. Most likely, more users will do something on a page, and this will affect the search ranking.


John Muller also said that Google Bot will soon support HTTP/2. And who knows, maybe in the future the HTTP 2 will become a ranking factor. After all, the search engines are constantly changing algorithms.

The benefits for web developers

HTTP 2 allows you to get rid of old tricks, designed to speed up the page loading without HTTP/2. We list them:


  • Domain-sharding or using the multiple related domains to download files to enable more TCP connections establishing.
  • Sprites of pictures — combining pictures in one file to reduce the number of requests. However, such a file must first be completely loaded to be displayed. In addition, processing large files consumes more memory.
  • Combine the CSS and JavaScript files, which is also done to reduce the number of requests, and also increases the memory usage.
  • Inline inclusion or putting CSS and JavaScript, and sometimes even pictures inside the HTML file, to reduce the number of connections. At the same time, the page is not displayed until the entire file is loaded.
  • Domains without cookie files: download images, CSS and JavaScript from another domain where cookies are not used.

How to connect HTTP 2

The era of HTTP/2 is just around the corner, many browsers already support this protocol. Its implementation does not require any changes to the site itself. You do not need to change the pages URL, links, set up the redirects, add or change any markup, or specify additional data for Google Search Console.


The HTTP/2 is performed on the part of the server that renders pages to users, that is, on hosting. If you are using external hosting, then probably your pages are already are rendered to the users via HTTP/2. If you use your own virtual or dedicated server, then add the nginx module to support HTTP/2.


HTTP 2 is backward compatible with HTTP 1.1. This means that there is no need to migrate your site to a new protocol. For some time, it will work almost the same as before.


Gradually, as the popular Web servers and web browsers migrate to HTTP 2, the site will slow down. This is due to site optimization techniques — what worked for HTTP/1.1, will become irrelevant for HTTP 2 or even slow down the website.


Continue to merge the images into sprites. In HTTP/1.1, small images were combined into a single sprite file to speed up the download. The browser made one request instead of a hundred and quickly downloaded the site. Multiplexing in HTTP/2 solved this problem, although combining images improves compression and reduces the total amount of downloaded data.


In HTTP/2, it is better not to embed images using Data URI. This technique is often used with JS and CSS concatenation to bypass the number of HTTP requests limit. Because of this, the user loads a lot of unnecessary files, there are difficulties with caching. If HTTP requests do not require significant resources, then you can go without it. Loading a lot of small style files is not a problem. There will be no difficulties with validity periods expiration and cache.


Domain sharding is no longer needed. In HTTP/1.1, there is a limit on the number of open connections. In order to bypass it, you have to load static resources from several subdomains. This technique is called domain sharding. As a rule, it is used to accelerate the pages with a large number of images loading. With HTTP 2, you can request the required amount of resources, and will not need to distribute the content across subdomains. Moreover, sharding will reduce performance, as it will create additional connections and slow down the download.

Leave a Reply

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