What is the difference between HTTP/1.1 and HTTP/2?
Short answer
HTTP/1.1 is text-based and processes requests in order over a connection; for many concurrent requests, the browser opens more than one connection. HTTP/2 carries the same semantics (methods, headers, status codes) with binary frames: with multiplexing, it transmits multiple requests concurrently as streams over a single connection and compresses the headers; browsers use HTTP/2 only over TLS, and the version is selected with ALPN in the TLS handshake. In TR7, the client side is determined in the HTTP vService Frontend row, in its Protocol selector: HTTP/2 in the Encrypted (HTTPS) group offers HTTP/2 and HTTP/1.1 to the client, and HTTP/1.1 offers only HTTP/1.1. The Backend Service side is independent: on a Backend Service with SSL Service on, if the ALPN field is set to HTTP 2.0 enabled, HTTP/2 is tried first, and if it is not supported, the connection falls back to HTTP/1.1; on a Backend Service with SSL Service off, if Cleartext HTTP/2 (h2c) is checked, TR7 connects to the server directly with HTTP/2 without TLS. By default, both are off (HTTP 2.0 disabled) and TR7 connects to the Backend Service with HTTP/1.1.
Where It Is Used in TR7
| Where | Field / label | What for |
|---|---|---|
| Load Balancer → Load Balancer vService List → HTTP vService form → Frontend | Protocol → Encrypted (HTTPS) → HTTP/1.1 or HTTP/2 | The version offered on the client side |
| Load Balancer → Backend Services → Backend Service form → SSL Service | ALPN: HTTP 2.0 disabled (default) / HTTP 2.0 enabled | The version used on the Backend Service side |
| Load Balancer → Backend Services → Backend Service form | Cleartext HTTP/2 (h2c): off (default) / checked | HTTP/2 without TLS to the Backend Service while SSL Service is off |
| Load Balancer → Profiles (L4-L7 Behavior Sets) → Health Checks → HTTP / HTTPS profile | HTTP Version: HTTP/1.1 (default) / HTTP/2 | The version of the health check request |
| Load Balancer → Actions (Policy Actions) | Keep Header Names | Turns off HTTP/2 and HTTP/3 on the vService it is bound to; connections are made with HTTP/1.1 |
Comparison
| HTTP/1.1 | HTTP/2 | |
|---|---|---|
| Format | Text | Binary frame |
| Concurrency | Sequential per connection | Multiple streams on a single connection |
| Header compression | None | Yes (HPACK) |
| TLS | Optional | Mandatory in browsers |
| Definition | RFC 9112 | RFC 9113 |
Common Misconceptions
- "If the Frontend is HTTP/2, HTTP/2 also goes to the Backend Service." The two sides are independent; the Backend Service side is determined by the ALPN field (on an unencrypted connection, by the Cleartext HTTP/2 (h2c) setting) and the default is HTTP/1.1.
- "When HTTP/2 is selected on the Frontend, HTTP/1.1 clients cannot connect." The HTTP/2 option also offers HTTP/1.1 in ALPN; a client that does not support HTTP/2 connects with HTTP/1.1.
- "HTTP/2 requires changes in the application." Methods, headers and status codes are the same; what changes is the transport format.
How it is done in the documentation
Related questions
