Episode 1 — Fundamentals / 1.4 — Understanding HTTP and HTTPS
1.4.a — What is HTTP and Its Different Versions?
In one sentence: HTTP (HyperText Transfer Protocol) is the application-layer language browsers and servers use to exchange web resources; each version changes how efficiently and safely those messages move over the network.
Navigation: ← 1.4 Overview · 1.4.b — HTTP Status Codes →
1. What is HTTP?
HTTP is a stateless, request–response protocol. A client (usually a browser) sends a request; a server returns a response. The server does not inherently remember past requests — state is added with cookies, tokens, sessions, or application design.
| Property | Meaning |
|---|---|
| Application layer | Sits above TCP (or QUIC for HTTP/3) — defines what is said, not how bits cross every hop |
| Text-based (HTTP/1.x) | Headers are readable lines like Host: example.com |
| Resource-oriented | URLs identify things (pages, APIs, images) |
| Extensible | New headers and semantics evolve over time (RFC 9110 family today) |
Minimal mental model
CLIENT (browser) SERVER (origin / CDN)
│ │
│ HTTP REQUEST │
│ method + path + headers + body? │
│ ─────────────────────────────────────►│
│ │
│ HTTP RESPONSE │
│ status + headers + body (HTML/JSON…) │
│ ◄─────────────────────────────────────│
2. Anatomy of an HTTP Message (Quick Refresher)
Request (HTTP/1.1 style)
GET /articles/42 HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 …
Accept: text/html,application/json;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Response
HTTP/1.1 200 OK
Date: Sat, 11 Apr 2026 12:00:00 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2048
Cache-Control: max-age=60
<!DOCTYPE html>…
3. HTTP Versions — Timeline and Trade-offs
| Version | Era | Transport | What changed (high level) |
|---|---|---|---|
| HTTP/0.9 | 1991 | TCP | Single GET /path line; only GET; response was raw HTML — no headers |
| HTTP/1.0 | 1996 | TCP | Full request/response with headers; often one request per TCP connection |
| HTTP/1.1 | 1997+ (RFC 9110 family) | TCP | Persistent connections, Host header required, chunked bodies, better caching semantics |
| HTTP/2 | 2015 (RFC 9113) | TCP | Binary framing, multiplexing many streams on one connection, header compression (HPACK) |
| HTTP/3 | 2022 (RFC 9114) | QUIC (UDP) | Same HTTP semantics, different transport: faster handshakes, better loss recovery, no TCP HOL blocking |
ASCII: evolution of “how many things can fly on one wire?”
HTTP/1.0 HTTP/1.1 (keep-alive) HTTP/2 (multiplex) HTTP/3 (QUIC)
────────── ─────────────────── ───────────────── ─────────────
[req][close] [req][resp][req][resp]… [req1] QUIC
same TCP socket [req2] } one TCP encrypts
[req3] } connection + streams
over UDP
4. HTTP/1.1 — Still the “Default Mental Model”
Strengths: simple to debug with curl -v, universal support, great for learning.
Pain points:
- Head-of-line blocking at HTTP layer — one slow response can delay others on the same connection in practice (mitigated by multiple TCP connections in browsers — costly).
- Verbose headers repeated on every request (mitigated in practice by compression and connection reuse).
5. HTTP/2 — Multiplexing and Efficiency
Key idea: many requests/responses in parallel on one TCP connection via streams.
Benefits:
- Fewer TCP connections (better for congestion control and TLS)
- Header compression (HPACK)
Caveat:
- TCP-level head-of-line blocking still exists — a lost TCP segment can delay all streams until repaired.
6. HTTP/3 — QUIC Changes the Transport
Key idea: HTTP/3 runs over QUIC (UDP-based) with integrated TLS 1.3 in common stacks.
Why it matters:
- Faster connection establishment (often fewer round trips than TCP+TLS classic stacks)
- Stream independence — loss on one stream doesn’t block unrelated streams the same way TCP can
- Connection migration — moving Wi‑Fi → cellular can be smoother (in supported deployments)
Interview tip: HTTP/3 is still “HTTP” — methods, status codes, headers (mostly) — but framing differs from HTTP/1.1’s plain text.
7. “Which version am I using?”
In Chrome DevTools → Network → click a request → Protocol column often shows h2, http/1.1, or QUIC / h3.
8. Key Takeaways
- HTTP defines requests and responses between clients and servers.
- It is stateless at the protocol level — sessions are an application pattern.
- Versions trade simplicity (1.1) for performance (2) and transport modernization (3).
- HTTP/2 multiplexes on TCP; HTTP/3 uses QUIC/UDP to address transport limitations.
Explain-It Challenge
Explain without notes:
- What does stateless mean for HTTP, and how do cookies still “remember” you?
- One advantage of HTTP/2 over HTTP/1.1 for a page with many small assets.
- Why HTTP/3 is not “HTTP over TCP.”
Navigation: ← 1.4 Overview · 1.4.b — HTTP Status Codes →