How HTTP/2 Outperforms HTTP/1: Multiplexing, Header Compression & Server Push
This article compares HTTP/2 with its predecessor HTTP/1.x, detailing performance gains through multiplexing, binary framing, header compression, and server push, and explains the underlying mechanisms such as TCP behavior, binary frames, static and dynamic header tables, illustrating concepts with visual examples.
HTTP Definition
HTTP (HyperText Transfer Protocol) is the protocol used to transfer hypertext from web servers to browsers.
HTTP Development History
HTTP 2.0 vs HTTP 1.x Performance
HTTP 2.0 dramatically improves web performance compared with HTTP 1.x.
The Akamai demonstration shows that loading 379 images with HTTP/2 reduces load time significantly compared with HTTP/1.1.
Differences Between HTTP 2.0 and HTTP 1.1
Difference 1: Multiplexing
Multiplexing allows a single HTTP/2 connection to carry multiple request‑response streams simultaneously.
TCP provides ordered byte streams, but HTTP/2 introduces binary framing to interleave data from different streams without breaking order.
In the binary framing layer, HTTP/2 splits all transmitted information into frames, encoding them in binary. Header information is placed in HEADER frames, while the request body goes into DATA frames.
By sharing a single TCP connection among multiple streams, HTTP/2 reduces the impact of TCP slow‑start, leading to lower latency and higher throughput.
Summary: Multiplexing enables a single connection to serve multiple resources, reducing server connection pressure, memory usage, and TCP slow‑start overhead, thereby increasing throughput.
Difference 2: Header Compression
In HTTP/1, request and response headers are sent as plain text, consuming bandwidth despite being largely static.
HTTP/2 compresses headers using a static and a dynamic table, together with Huffman coding.
Static Table: contains common header names and frequently used name‑value pairs.
Dynamic Table: can be populated during a connection with new entries.
Huffman Coding: encodes header data based on a static Huffman code table.
For a fully matching header like :method: GET, a single character can represent the pair; for partially matching headers such as cookie: …, the name can be represented by a single character.
Difference 3: Server Push
Server push allows the server to send resources to the client before the client explicitly requests them, reducing latency.
When the server knows that a page will need additional assets (CSS, JS, images), it can push them immediately after responding to the initial HTML request, keeping the network fully utilized.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
