HTTP/2.0: Why Do We Need It?
We have been using HTTP/1.1 successfully for the last 15 years so why do we need HTTP/2.0? What is the motivation for the new version of the HTTP protocol? Let’s start by looking at the problems with HTTP/1.1.
I often post about HTTP/2.0 on Twitter. Follow @readlearncode
Problem with HTTP/1.1
What’s in a Web page?
In fact over the last five years, since April 2011, the average size of a top 1000 web page has increased by over 300% to 2101 bytes according to the HTTP Archive and the average web page now loads over 120 resources.
How does the browser load a web page?
The browser requests the web page and finds that it requires a number of resources. It then starts to request these resources one at a time.
In the beginning, HTTP/1.0 allowed only one request to be made via a single TCP connection. In HTTP/1.1 this was addressed with pipelining, the browser can make multiple requests
Solution to Head-Of-Line Blocking
What are the ways we solved this problem?
- TCP sockets are expensive to create and
- For a given browser there is maximum number of connection per host
Given these restrictions, we looked for a different way to optimize page loading.
Many of the solution devised to address these issue are workarounds to overcome the shortcomings in HTTP/1.1. So what are these hacks?
Image Sprite Sheet
The pages icons are contained within one image file and are cut from this it into the separate icons and images.
A lot of time is spent encoding and decoding and caching cannot be easily done.
Get an overview of the changes coming in HTTP/2.0 and how these are implemented in Java EE 8. I this article we talk about the specification and the support that will be available in Java 9 and JavaEE 8.
One of the most important developments in JavaEE 8 and Java 9 will be support for HTTP/2. Tomcat 9 supports HTTP/2 but it must be configured to use TLS. Head on over to Configure Tomcat 9 for HTTP/2 to find out how to add the appropriate configurations.
The adoption of HTTP/2.0 has stagnated over the last four months. In this new article, we show how server providers are not migration to HTTP/2.0.