HTTP1.1 vs HTTP 2:

visshnnu tejaa
3 min readDec 2, 2020

HTTP 2.0 is an improvement for HTTP1.1 protocol. To know the differences between them we should know what is HTTP.

HTTP is Hyper Text Transfer Protocol. The first HTTP protocol was introduced in 1991 named with HTTP 0.9. It support methods like GET, POST, HEAD. At that time there are very basic websites with multiple pages hyperlinked to each other. but there wont be any effect even the speed is very low because the websites are also basic

In 1996 http 1.0 protocol is introduced. This will support methods like PUT, DELETE, LINK, UNLINK along with few other things. In next year 1997 HTTP1.1 protocol was introduced. we are still using this protocol since it was introduced. At that time, Internet landscape was constantly changing with websites, becoming more dynamic and heavy. features like CORS, keep-alive was introduced in this update

To understand what is HTTP2.0, we should know what are the drawbacks of HTTP1.1

In http1.1, the TCP connections established from client to server is limited . this will leads to HOL (Head of line blocking). when ever a client sends a request for indexd.html, then TCP connection is created between client to server. firstly it is a single TCP connection. It will wait for the response of that index.html ( assume). Here TCP connection gets blocked till the response is received. once it receives the response then again it will send a request for the CSS and JS files. later it will increased to 6 TCP parallel connections. but now, these 6 TCP connections are not enough because websites/web pages are huge we can not handle

Repetition of header data is also one of the drawback in HTTP1.1

http is a stateless protocol in which every request is independent of previous and next request. Here the Header is packed with each http request. this is a use less data which is sent to every request and it can not be compressed. Keep-alive option enables re-using of the same TCP connection for multiple HTTP request. It is not too much of relief to a website developers. because they have to do a lot of stuff to make their website fast. Keep-alive is when a TCP connection is created, initially every TCP connection is created for http request and response was created fresh. so, one request is made then a new TCP connection is created, and after getting the response it is destroyed. for next http request then a new TCP connection is created. so, this was not working well

Here goes the HTTP2.0 overcomes the drawbacks in HTTP1.1

HTTP2.0 was introduced in 2015. In http 2.0, a single TCP connection is being is used. in which streams are created. in which every http request is enters in to the stream frame. so, single TCP connection pipe line is used. and its compulsory have TLS setup. here HTTP is a mandatory requirement to http 2.0. Here a single secured connection is created which streams are created for different requests. so, it became faster. and the client manages the streams well. This is a kind of multiplexing a streams in to one PCB connection. Another great thing about http 2.0 is HPACK

  • Here Header data is separated from request data and can be zipped
  • HPACK also enables reuse of header data which is repeated in every request

HPACK also enables reuse of header data which is repeated in every request

  • HPACK reduces http request size.
  • PUSH frames
  • PUSH frames enables us to send resources like JS,CSS files in advance along with an http response
  • PUSH frames should be used with care as this can lead to increase in size of the http response
  • You can keep on using gzip, leverage browser caching minify CSS?JS, etc. to further improve the speed
  • Almost all the modern web services support this
  • Don’t worry about losing users as users using old browsers with support of http 1.1 will be served the website over http 1.1 only

--

--