What is the difference between HTTP 1.1 and HTTP 2.0? [closed]
Asked Answered
P

2

234

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?

Par answered 18/2, 2015 at 19:21 Comment(3)
this video looks good to talk about those topics youtube.com/watch?v=0L5Q_897fwkRetroflexion
'Introduction' section of tools.ietf.org/html/rfc7540 is the purest and best source for difference between HTTP 1.1 and HTTP 2.0Andriette
@Andriette - true that. I find RFC introductions/abstracts in general to be one of the best high-level overviews of topics.Dragnet
E
201

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.

Eller answered 18/2, 2015 at 19:32 Comment(1)
Just to add one more, http/2 specifies server push too. Read more about it here: en.wikipedia.org/wiki/HTTP/2_Server_PushLackaday
N
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.

Neisa answered 18/2, 2015 at 19:24 Comment(4)
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.Kisung
@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.Elatia
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.Declivity
Also, while the headers are case-insensitive, the protocol requires transmission in lowercase.Declivity

© 2022 - 2024 — McMap. All rights reserved.