233

HTTP/1.1 has served the Web well for more than fifteen years, but its age is starting to show.

Can anybody explain what is the main difference between HTTP 1.1 and 2.0?

Is there any change in the transport protocol?

ivanleoncz
  • 9,070
  • 7
  • 57
  • 49

2 Answers2

200

HTTP/2 supports queries multiplexing, headers compression, priority and more intelligent packet streaming management. This results in reduced latency and accelerates content download on modern web pages.

More details here.

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222
master-lame-master
  • 3,101
  • 2
  • 30
  • 47
  • 8
    Just to add one more, http/2 specifies server push too. Read more about it here: https://en.wikipedia.org/wiki/HTTP/2_Server_Push – Nitin Bansal Nov 21 '16 at 21:18
94

HTTP 2.0 is a binary protocol that multiplexes numerous streams going over a single (normally TLS-encrypted) TCP connection.

The contents of each stream are HTTP 1.1 requests and responses, just encoded and packed up differently. HTTP2 adds a number of features to manage the streams, but leaves old semantics untouched.

phihag
  • 278,196
  • 72
  • 453
  • 469
  • 43
    TLS-encryption is not optional. It may be optional by the protocol, but not in the real world. Chrome and other browsers will not accept http2 without https. So in the real world if you enable http2 without installing a cert on your server, the browsers will just connect with http1. – Patrick Collins Mar 02 '17 at 17:19
  • @PatrickCollins Actually browsers will connect with HTTP2 but will just initiate a download of the binary packet stream. They just don't know how to display HTTP2 content without SSL. – Avamander May 22 '17 at 14:10
  • 4
    This answer is misleading in the assertion that http/2 just packs and encodes http/1.1 requests. There are specific differences. For example, the headers are sent separately from the body/payload. Also, the header format has changed slightly - where in http/1.x the method, uri, response codes and protocol versions are passed in the first line, called the request line. Http/2 introduces the concept of psuedoheaders, placed before all other headers and prefixed with a `:` to handle these aspects, except protocol version, which has no equivalent in http/2. – Erikest Jun 22 '17 at 21:23
  • 3
    Also, while the headers are case-insensitive, the protocol requires transmission in lowercase. – Erikest Jun 22 '17 at 21:24