Which Wins: HTTPS, SPDY, or HTTP/2? A Real-World Performance Comparison
This article translates and expands a performance study that pits HTTPS, SPDY/3.1, and HTTP/2 against each other using Firefox and HttpWatch on Google UK's homepage, revealing trade‑offs in header compression, response size, connection multiplexing, and page‑load speed.
HTTP/2 promises clear performance gains, but the use of padding in response data introduces a potential trade‑off between speed and security.
Recent browser updates have made it possible to test these protocols: Firefox 35 ships with HTTP/2 support (draft 14) enabled by default, while Chrome requires manual activation via about://flags. HttpWatch now displays the protocol used for each request.
Performance Comparison
The tests were conducted with Firefox and HttpWatch on the Google UK homepage, switching between three protocols—original HTTPS, SPDY/3.1, and HTTP/2—by toggling settings in about:config. All tests used an empty cache.
Test #1: Request and Response Header Size
Most sites compress page content, but HTTP/1.1 cannot compress headers. SPDY uses the DEFLATE algorithm, while HTTP/2 employs the HPACK algorithm, which combines predefined tokens, a dynamic table, and Huffman coding.
Screenshot of header sizes (sent and received) shows HTTP/2 producing the smallest headers.
Winner: HTTP/2
Test #2: Response Size
Response size includes headers and the encoded body. Although HTTP/2 has the smallest headers, SPDY delivers a smaller overall response for text content because HTTP/2 adds optional padding bytes to data frames.
Images illustrate the larger response size for HTTP/2 due to padding.
Padding can obscure the true size of frames and mitigate attacks such as BREACH, but it is not applied to already‑compressed image files.
Winner: SPDY
Test #3: TCP Connections and SSL Handshake Time
Increasing the maximum concurrent connections per domain improves performance in HTTP/1.1. SPDY and HTTP/2 reduce the number of TCP and SSL handshakes by multiplexing multiple requests over a single connection.
Both protocols show lower handshake overhead compared with plain HTTPS.
Joint Winners: SPDY & HTTP/2
Test #4: Page Load Time
Page‑load time measured by HttpWatch reflects the moment the page is fully downloaded and usable. HTTP/2 consistently achieved the fastest load times, while HTTPS lagged due to lack of header compression and multiple connections.
Winner: HTTP/2
Conclusion
HTTP/2 appears to deliver noticeable performance advantages, yet the padding used in response data creates a nuanced trade‑off between speed and security.
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.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
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.
