Back to All Concepts
NetworkingProtocolsPerformanceWebIntermediate

HTTP Evolution (H1 to H3)

From text-based HTTP/1.1 to binary HTTP/2 and UDP-based HTTP/3 (QUIC). Why we needed upgrades and how they solve Head-of-Line Blocking.

The Need for Speed

The web has changed. We went from simple HTML pages to complex applications with hundreds of assets (JS, CSS, Images).

HTTP/1.1 (1997)

Protocol: Text-based (ASCII). Transport: TCP.

The Problem: Head-of-Line Blocking (HOL)

HTTP/1.1 processes requests sequentially on a connection.

  1. Browser asks for style.css.
  2. Browser asks for script.js.
  3. If style.css takes 5 seconds, script.js waits (blocked).

Workaround: Browsers open 6 TCP connections per domain. (Still limited).

HTTP/2 (2015)

Protocol: Binary. Transport: TCP.

The Solution: Multiplexing

HTTP/2 allows multiple streams over a single TCP connection.

  • Requests are broken into binary frames.
  • Frames are interleaved.
  • script.js frames can arrive before style.css frames if they are ready first.
mermaid
sequenceDiagram
    participant C as Client
    participant S as Server
    
    C->>S: Stream 1: GET /style.css
    C->>S: Stream 2: GET /script.js
    
    S->>C: Stream 2 Data (script.js chunk 1)
    S->>C: Stream 1 Data (style.css chunk 1)
    S->>C: Stream 2 Data (script.js chunk 2 - Done)
Click to expand code...

Other Features

  • Header Compression (HPACK): Don't send User-Agent: Chrome repeatedly.
  • Server Push: Server sends style.css before browser asks (Deprecated in Chrome 2022 due to complexity).

The New Problem: TCP HOL Blocking

HTTP/2 fixed Application HOL blocking but introduced Transport HOL blocking. If one packet is lost in TCP, the OS holds back all streams until that packet is retransmitted. One dropped packet slows down everything.

HTTP/3 (2022)

Protocol: Binary (QUIC). Transport: UDP (User Datagram Protocol).

The Solution: QUIC

Builds reliable transport on top of UDP in user-space.

  • Independent Streams: Packet loss in Stream 1 does not affect Stream 2.
  • 0-RTT Handshake: Faster connection setup (TLS 1.3 built-in).
  • Connection Migration: Switch from Wi-Fi to 5G without reconnecting (Connection ID persists).
mermaid
graph TD
    subgraph HTTP_Stack_Comparison
        direction LR
        
        subgraph H1 [HTTP/1.1]
            L1_H1[HTTP/1.1] --> L1_TLS[TLS]
            L1_TLS --> L1_TCP[TCP]
            L1_TCP --> L1_IP[IP]
        end
        
        subgraph H2 [HTTP/2]
            L2_H2[HTTP/2] --> L2_TLS[TLS]
            L2_TLS --> L2_TCP[TCP]
            L2_TCP --> L2_IP[IP]
        end
        
        subgraph H3 [HTTP/3]
            L3_H3[HTTP/3] --> L3_QUIC[QUIC (Reliability+TLS)]
            L3_QUIC --> L3_UDP[UDP]
            L3_UDP --> L3_IP[IP]
        end
    end
Click to expand code...

Performance Comparison

FeatureHTTP/1.1HTTP/2HTTP/3
TransportTCPTCPUDP (QUIC)
MultiplexingNo (Pipelining failed)YesYes
HOL BlockingApp LayerTransport LayerNone
SecurityTLS OptionalTLS Required (Implicit)TLS 1.3 Built-in
Handshake2-3 RTT2-3 RTT0-1 RTT

Code Example: Go Server (Generic)

Implementing versions is often transparent to app logic.

go
package main

import (
	"fmt"
	"net/http"
	"golang.org/x/net/http2"
)

func handler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Protocol: %s", r.Proto)
}

func main() {
    server := &http.Server{Addr: ":443"}
    
    // Enable HTTP/2 automatically if using TLS
    http2.ConfigureServer(server, &http2.Server{})
    
    http.HandleFunc("/", handler)
    
    // Serve HTTPS (Required for H2/H3 in browsers)
    server.ListenAndServeTLS("cert.pem", "key.pem")
}
Click to expand code...

Interview Tips šŸ’”

  • "Why UDP?" — TCP is too hard to change (ossified in middleboxes). UDP is just a raw socket. We implemented TCP features (reliability, congestion control) on top of UDP in user-space (QUIC).
  • "What is HOL blocking?" — Explain both App-layer (H1) and Transport-layer (H2/TCP) variations.
  • "0-RTT" — If client has talked to server before, it can send data in the first packet. Risk: Replay Attacks.
  • "Server Push" — Mention it failed in practice because server doesn't know browser cache state. 103 Early Hints is the modern replacement.

Related Concepts

About ScaleWiki

ScaleWiki is an interactive educational platform dedicated to demystifying distributed systems, software architecture, and system design. Our mission is to provide high-quality, technically accurate resources for software engineers preparing for interviews or solving complex scaling challenges in production.

Read more about our Editorial Guidelines & Authorship.

Educational Disclaimer: The architectural patterns and system designs discussed in this article are based on common industry practices, technical whitepapers, and public engineering blogs. Actual implementations in enterprise environments may vary significantly based on specific product requirements, legacy constraints, and evolving technologies.

Related Articles