Markdown

HTTP/2

HTTP/2 is the Acronym for Hypertext Transfer Protocol Version 2

A major revision of the HTTP network protocol used by the World Wide Web, HTTP/2 was derived from the earlier experimental SPDY protocol, originally developed by Google. It was developed by the HTTP Working Group (also called httpbis) of the Internet Engineering Task Force (IETF). HTTP/2 was the first new version of HTTP since HTTP/1.1, which was standardized in RFC 2068 in 1997. The Working Group presented HTTP/2 to the Internet Engineering Steering Group (IESG) for consideration as a Proposed Standard in December 2014, and IESG approved it to publish as Proposed Standard on February 17, 2015. The initial HTTP/2 specification was published as RFC 7540 on May 14, 2015. The standardization effort was supported by the Chrome, Opera, Firefox, and Edge browsers.

Core Improvements

Multiplexing: In HTTP/1.1, requests had to be processed one at a time, like waiting in a single line at a store. If one request was slow, it would block all others behind it (head-of-line blocking). HTTP/2 introduces multiplexing, sending multiple requests and responses simultaneously over a single connection. This dramatically reduces waiting time and improves overall performance.

Header Compression: HTTP headers contain important information about each request and response. In HTTP/1.1, these headers were sent in plain text with every request, even if they hadn't changed. HTTP/2 introduces HPACK compression, which compresses header information to reduce bandwidth usage, maintains a list of previously used headers to avoid sending duplicate information, and can reduce header sizes by up to 80%.

Server Push: Traditional HTTP requires the client (browser) to analyze a webpage and then request additional resources like images or stylesheets one by one. HTTP/2's server push allows servers to send resources to the client before they're requested proactively. For example, when requesting an HTML page, the server can immediately push related CSS and JavaScript files, knowing the client will need them.

Binary Protocol: HTTP/1.1 used a text-based format, which was human-readable but inefficient for machines to process. HTTP/2 switches to a binary protocol, which is more efficient to parse, reduces errors in transmission, enables features like multiplexing, and processes data faster.

Stream Prioritization: Not all resources are equally important when loading a webpage. HTTP/2 allows clients to assign priority levels to different requests. For example, critical content (text, layout) can be prioritized, while less important resources (background images) can be loaded later. Developers can optimize the loading sequence for a better user experience (UX).

Real-World Benefits

  • Faster page loads: Pages can load 15-50% faster
  • Reduced server load: Fewer connections needed per client
  • Lower bandwidth usage: Compressed headers and efficient protocols
  • Better mobile performance: More efficient use of limited mobile bandwidth
  • Improved user experience: Content appears more quickly and smoothly

HTTP/2 was designed to be fully backward compatible with HTTP/1.1. Servers and clients not supporting HTTP/2 automatically fall back to HTTP/1.1, ensuring a smooth transition as the web evolves.

Articles Tagged HTTP/2

View Additional Articles Tagged HTTP/2