HTTP/2 keeps the same meaning as HTTP/1.1: the same methods, status codes and headers. It changes how messages travel on the wire.
The main changes:
- Binary framing: messages are split into binary frames instead of text lines. Binary frames are easier to parse correctly.
- Multiplexing: many requests and responses run in parallel as separate streams over one TCP connection. Browsers no longer need six connections per origin. One slow response does not block the others at the HTTP layer.
- HPACK: this compresses headers. It helps because cookies and user agents repeat on every request.
- Priorities: streams can also carry priorities.
HTTP/1.1 tricks like domain sharding (spreading files over many domains) and sprite sheets become unneeded, or even harmful.
One limit remains. All streams share one TCP connection. So a lost packet stops every stream until TCP sends it again. This is TCP-level head-of-line blocking.
- HTTP/2 keeps the same meaning as HTTP/1.1 but uses binary framing.
- Many streams run in parallel over one TCP connection.
- HPACK compresses headers.
- HTTP/1.1 workarounds become unneeded.
- Head-of-line blocking at the TCP level still remains.
Read more
- HTTP/2 (MDN) (https://developer.mozilla.org/en-US/docs/Glossary/HTTP_2)developer.mozilla.org
- RFC 9113: HTTP/2 (https://www.rfc-editor.org/rfc/rfc9113)rfc-editor.org