Web Protocols Cheat Sheet – Frontend System Design

HTTP/1.x and HTTP/2 represent two major versions of the Hypertext Transfer Protocol used for the World Wide Web. HTTP/1.x, with its final iteration being HTTP/1.1, has been the backbone of the web for decades. Its simplicity and text-based nature characterize it, making it easy to use and understand. HTTP/1.1 can reuse a TCP connection with keep-alive, but it still processes one request at a time on that connection (head-of-line blocking), which gets inefficient when a page has many assets.
HTTP/2, on the other hand, introduced several key improvements to enhance web performance and efficiency. One of the most significant changes is the introduction of multiplexing, allowing multiple requests and responses to be sent asynchronously over a single TCP connection, reducing latency and improving page load times. HTTP/2 also incorporates header compression to reduce overhead. It once included server push (sending resources before the client asked), but browsers later dropped server push, so don’t rely on it. Despite these advancements, HTTP/2 maintains high-level compatibility with HTTP/1.x, ensuring that applications built on the older versions can be upgraded without drastic changes.
| Feature | HTTP/1.x Pros | HTTP/2 Pros |
|---|---|---|
| Connection Management | Simple; HTTP/1.1 can reuse a connection (keep-alive), but still handles one request at a time per connection. | Multiple requests and responses can be multiplexed over a single TCP connection, reducing overhead. |
| Performance | Well-understood behavior and widespread support across web infrastructure. | Significantly improved performance through header compression, request prioritization, and multiplexing. |
| Resource Loading | Sequential loading can be simpler for developers to manage and predict. | Concurrent loading of resources reduces page load times and improves user experience. |
| Protocol Overhead | HTTP/1.x’s textual nature can be more readable and easier to debug manually. | Binary framing layer reduces overhead and improves |
