HTTP
Explains HyperText Transfer Protocol (HTTP)
Jul 17, 2025
HTTP/1.1
Introduced persistent connections, pipelining, and better caching mechanisms. It became the standard for web communication for decades.
- Flow:
- Client opens a TCP connection (can be reused for multiple requests).
- Client sends a request with headers (e.g.,
Hostheader required). - Server responds with status, headers, and content.
- Connection remains open for further requests unless explicitly closed (
Connection: close). - Optional pipelining allows multiple requests without waiting for responses.

HTTP/2
Improved performance using binary framing, multiplexing, and header compression. Built on SPDY, it operates over a single TCP connection.
- Binary framing for efficiency.
- Stream multiplexing for concurrent requests.
- Header compression (HPACK).
- Server push for faster resource delivery.
- Prioritization of streams.
- Typically requires TLS.
- Flow:
- Client establishes a single TCP connection (often over TLS).
- Requests and responses are split into binary frames and sent over streams.
- Multiple streams are multiplexed over the same connection, allowing concurrent requests.
- Server pushes resources proactively (server push).
- Connection remains open for multiple exchanges.

- Differences from HTTP/1.1:
- Binary protocol instead of text-based.
- Multiplexing allows multiple requests/responses simultaneously.
- Header compression (HPACK) reduces overhead.
- Server push for proactive resource delivery.
- Requires TLS in most implementations for security.
HTTP/3
Built on QUIC (a UDP-based protocol) instead of TCP, reducing latency and improving performance in lossy networks. Uses binary framing like HTTP/2.
- QUIC transport protocol for lower latency.
- No head-of-line blocking at the transport layer.
- Built-in TLS 1.3 encryption.
- Stream multiplexing and prioritization.
- Server push.
- Improved performance in unreliable networks.
- Flow:
- Client establishes a QUIC connection over UDP (usually with TLS 1.3).
- Requests and responses are sent as binary frames over QUIC streams.
- Multiplexing allows concurrent streams without head-of-line blocking.
- Server push and prioritization are supported.
- Connection persists for multiple exchanges.

- Differences from HTTP/2:
- Uses QUIC over UDP instead of TCP, reducing connection setup time.
- Eliminates head-of-line blocking at the transport layer.
- Faster connection establishment with QUIC’s 0-RTT or 1-RTT handshakes.
- Better performance in high-latency or lossy networks.
| Version | Transport | Key Features | Diff from Previous | Usage |
|---|---|---|---|---|
| HTTP/1.1 | TCP | Persistent connections, pipelining, caching | Keep-alive, new methods, caching | Dominant, APIs, websites |
| HTTP/2 | TCP (TLS) | Binary, multiplexing, header compression, server push | Binary protocol, multiplexing, HPACK | Modern websites, performance-critical apps |
| HTTP/3 | QUIC (UDP) | QUIC, no head-of-line blocking, low latency | QUIC over UDP, faster handshakes | Mobile, low-latency apps, growing adoption |