Web Protocols

What is HTTP/2?

Also known as: H2

Definition

HTTP/2 is a binary, multiplexed version of HTTP that reduces latency through header compression, stream prioritization, and server push, as defined in RFC 7540.

HTTP/2 is a major revision of the HTTP protocol, standardized in May 2015 as RFC 7540 and updated by RFC 9113 in 2022. It replaces HTTP/1.1's text-based, serial request-response model with a binary framing layer. This change allows multiple concurrent exchanges (streams) to be multiplexed over a single TCP connection, eliminating head-of-line blocking at the application layer.

The protocol organizes data into frames within streams. A single connection can hold hundreds of streams, with each stream carrying request and response messages broken into frames. Streams can be prioritized using a weighted dependency tree, so the server allocates bandwidth to important resources first. Header compression via HPACK (RFC 7541) reduces redundant header data, shrinking overhead from hundreds of bytes to a few. Server push enables the server to send resources the client has not yet requested, anticipating its needs. However, push is often disabled in practice due to caching complications.

HTTP/2 is a direct replacement for the HTTP/1.1 wire format but remains semantically compatible: methods, status codes, URIs, and header fields are unchanged. Most web browsers support it via TLS (with ALPN negotiation, using h2 identifier). It is the default protocol for HTTPS traffic on major web servers such as Apache, Nginx, and IIS. The key tradeoff is that its multiplexing benefits degrade under TCP packet loss, where a single lost packet can block all streams, a limitation addressed by HTTP/3 over QUIC.

Key facts

  • Defined in RFC 7540 (2015) and updated by RFC 9113 (2022).
  • Uses binary framing, with frames grouped into streams over one TCP connection.
  • HPACK header compression reduces redundant header overhead.
  • Server push allows the server to preemptively send resources before the client requests them.
  • Requires TLS with ALPN h2 in browsers; plaintext upgrade via h2c is rarely used.

How it works in practice

A web browser opens a single TCP connection to a server and requests an index.html file. The server begins sending the HTML and uses server push to send style.css and app.js simultaneously. As the browser parses the HTML, it finds links to those resources, but they are already arriving. Meanwhile, additional requests for images are multiplexed on stream IDs 5 and 7, all without opening new connections. HPACK compresses the repeated User-Agent and Cookie headers across these requests, saving hundreds of bytes per exchange.

Related terms

HTTP/3 QUIC HPACK ALPN SPDY Server Push

References

More in Web Protocols

CORS

CORS (Cross-Origin Resource Sharing) is a browser security mechanism that lets servers explicitly allow web pages from one origin to request resources from a different origin via HTTP response headers.

GraphQL

GraphQL is a query language and runtime for APIs that lets clients request exactly the data they need in a single round trip, reducing over-fetching and under-fetching.

gRPC

gRPC is a high-performance, open-source remote procedure call framework initially developed by Google. It uses HTTP/2 for transport, Protocol Buffers as its interface definition language and message serialization format, and supports bidirectional streaming.

HTTP

HTTP is a text-based request-response protocol that defines how web clients and servers exchange resources, forming the foundation of data communication on the World Wide Web.

HTTP Pipelining

HTTP Pipelining is a technique in HTTP/1.1 that sends multiple requests on a single connection without waiting for each response, now largely replaced by HTTP/2 multiplexing.

HTTP Status Code

A three-digit integer in an HTTP response that indicates the result of the server's attempt to process the request, grouped into five classes (1xx through 5xx).

HTTP/1.1

HTTP/1.1 is the persistent-connection version of the Hypertext Transfer Protocol, defined in RFC 2616 and updated by RFCs 7230-7235, enabling multiple requests and responses over a single TCP connection.

HTTP/3

HTTP/3 is the third major version of the Hypertext Transfer Protocol, which runs over QUIC instead of TCP to reduce latency, eliminate head-of-line blocking, and improve connection setup time.

HTTPS

HTTPS (HTTP Secure) is HTTP traffic encrypted inside a TLS session, protecting data confidentiality, integrity, and server authenticity between a client and a web server.

Keep-Alive

Keep-Alive, also called persistent connection, allows multiple HTTP requests and responses over a single TCP connection, reducing latency and overhead compared to opening a new connection per request.

Who Is Online

In total there are 67 users online: 0 registered, 59 guests and 8 bots.

Most users ever online was 5,555 on 17 Jul 2026, 3:23 am.

Bots: AhrefsBot Applebot Baiduspider Bingbot Other Bot Other Crawler PetalBot SemrushBot

Users active in the past 15 minutes. Total registered members: 369