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:
    1. Client opens a TCP connection (can be reused for multiple requests).
    2. Client sends a request with headers (e.g., Host header required).
    3. Server responds with status, headers, and content.
    4. Connection remains open for further requests unless explicitly closed (Connection: close).
    5. Optional pipelining allows multiple requests without waiting for responses.
Http1.1

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:
    1. Client establishes a single TCP connection (often over TLS).
    2. Requests and responses are split into binary frames and sent over streams.
    3. Multiple streams are multiplexed over the same connection, allowing concurrent requests.
    4. Server pushes resources proactively (server push).
    5. Connection remains open for multiple exchanges.
Http2
  • 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:
    1. Client establishes a QUIC connection over UDP (usually with TLS 1.3).
    2. Requests and responses are sent as binary frames over QUIC streams.
    3. Multiplexing allows concurrent streams without head-of-line blocking.
    4. Server push and prioritization are supported.
    5. Connection persists for multiple exchanges.
Http3
  • 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.
VersionTransportKey FeaturesDiff from PreviousUsage
HTTP/1.1TCPPersistent connections, pipelining, cachingKeep-alive, new methods, cachingDominant, APIs, websites
HTTP/2TCP (TLS)Binary, multiplexing, header compression, server pushBinary protocol, multiplexing, HPACKModern websites, performance-critical apps
HTTP/3QUIC (UDP)QUIC, no head-of-line blocking, low latencyQUIC over UDP, faster handshakesMobile, low-latency apps, growing adoption

Additional Notes