HTTP
HTTP Versions
HTTP/0.9
- Originally designed for simple HTML transferring with ASCII encoding.
- Response headers doesn't not exist, but simply returns the request file.
HTTP/1.0
- With WWW becoming popular, the need for supporting differnt file formats grows:
- Need to support different resource format
- Information of the resource's encoding and type must be included for client side to handle properly
- Response header are introduced
HTTP/1.1
- Text-based framing
- HTTP/1.0 build and close the connection on every request, which is resource consuming nad increases response time
- Connection is kept opened unless closed explicitly
- Often has a connection amount limitation to avoid resource exhaustion on the server (e.g Chrome limits 6 connection per domain)
- Introduces
Hostheader to support multiple host sharing a same IP - Introduces
Content-Lengthheader to support streaming data - Introduce cookie mechanism
- Improved caching headers such as: ETag, If-Unmodified-Since, If-Match, If-None-Match
- More request methods
- TCP connection issues:
- Each connection has the head-of-line (HOF) blocking issue
- TCP has a slow start issue
- Connections might race of bandwith, causing critical resource to take longer time to response
HTTP/2.0
- Binary-based framing
- Tries to solve TCP connection issue in HTTP/1.1 by introduces
multiplexingmechanism:- Requests/responses are break down to frames with id (
stream id) using binar framing technique, such that receiver can receive packets in any order and reconstruct the content. - Priority can be given to requests
- Requests/responses are break down to frames with id (
- Introduces header compression using HPack
- Allows servers to proactively send resources to the client, reducing latency and improving perceived page load times.
- Enhances security with encrypted connection
- Partially addresses the head-of-line blocking (HOLB) issue by using multiplexing, but HOLB still exists at the transport layer (TCP).
HTTP/3.0
- Introduces
QUICbased on UDP to implement multiplexing and reliable connection. - Based on TLS1.3
- Allow solves multiple issue in previous versions, still faces challenges such as:
- UDP support in routers are less optimized
- Device support
- Requires more memory
- Risks such as DDos attack
References
-
RFC Standards
-
Animation: HTTP/1.1 vs HTTP/2 vs HTTP/2 with Push -- Barry Pollard
-
What Is the Difference Between HTTP/1, HTTP/1.1 and HTTP/2? -- ExplainThis