Web & Network8 min readLast updated: Sun Mar 10 2024 00:00:00 GMT+0000 (Coordinated Universal Time)

HTTP/1.1 vs HTTP/2 vs HTTP/3

The web has become faster not just because of better internet speeds, but because the underlying language of the web (HTTP) has evolved.

HTTP/1.1 (The Old Standard)

Released in 1997, HTTP/1.1 served us well for decades.

  • Text-based: You could read the headers.
  • The Problem: "Head-of-Line Blocking". If you wanted to download 10 images, the browser had to open 6 separate connections. If one image was slow, it blocked the others behind it in that connection.

HTTP/2 (The Multiplexing Era)

Released in 2015, HTTP/2 changed the game.

  • Binary: It is no longer human-readable text. It uses binary framing.
  • Multiplexing: You can send multiple files over a single TCP connection at the same time. No more waiting for image #1 to finish before asking for image #2.
  • Header Compression: It shrinks the size of headers using HPACK.

HTTP/3 (The UDP Revolution)

HTTP/3 (QUIC) is the newest standard. It abandons TCP entirely.

  • Why drop TCP? TCP requires a "handshake" (SYN, SYN-ACK, ACK) which takes time. Also, if one packet is lost in TCP, the operating system holds up all data until that packet is re-sent.
  • Enter UDP: HTTP/3 uses UDP (User Datagram Protocol). UDP is fast but unreliable. HTTP/3 adds a layer on top called QUIC to make it reliable again, without the blocking issues of TCP.

Summary Table

Version Transport Format Key Feature
HTTP/1.1 TCP Text Keep-Alive connections
HTTP/2 TCP Binary Multiplexing (Parallel streams)
HTTP/3 UDP (QUIC) Binary No Head-of-Line Blocking