Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTTP

HTTP/1.0 vs HTTP/1.1 vs HTTP/2.0

  • HTTP/1.0 uses a new TCP connection for each request.
  • HTTP/1.1 can only have one inflight request in an open TCP connection but connections can be reused for multiple requests one after another.
  • HTTP/2.0 can have multiple inflight requests on the same TCP connection.
  # This will exit after this single request.
  telnet iduoad.com 80
  GET / HTTP/1.0
  HOST:iduoad.com
  USER-AGENT: curl

  # We can reuse the same connection for multiple requests.
  telnet iduoad.com 80
  GET / HTTP/1.1
  HOST:iduoad.com
  USER-AGENT: curl

  GET / HTTP/1.1
  HOST:iduoad.com
  USER-AGENT: curl