What is HTTP /2?

Derived from Google Spdy. The latest version of HTTP, an upgrade to HTTP /1.1. In efficiency, safety, speed brought great improvement.

What improvements did HTTP /2 bring?

  1. Single connection Each page establishes only one TCP connection until the page is closed, reducing the cost of connection establishment.
  2. Multiplexing Multiple requests can be made simultaneously on a connection
  3. Server push
  4. Priority Assigns priority to requests, and the server responds first to requests of higher priority.
  5. Binary HTTP /2 is in binary form, which is easier for the server to parse and saves text conversion time.
  6. Header compression reduces the repeated passing of duplicate header data in HTTP1.1, greatly reducing the size of bytes transmitted.

What are the benefits?

  1. Google says that sites that support HTTP /2 will be high on SEO
  2. Reduce TCP connections and reduce server overhead.
  3. Faster website

support

  1. HTTP /2 is backward compatible. If HTTP /2 is not supported, the switch is automatically switched to HTTP /1.1.
  2. According to the test, Google, FF and other mainstream browsers only support HTTP /2 running over HTTPS.

Impact on developers

Some of the web site acceleration techniques adopted in the HTTP /1.1 era to benefit from HTTP /2 are no longer needed. Such as:

  1. Domain name subdivision
  2. Image sprites
  3. File merging
  4. Inline files CSS, JS, and image files no longer need to be inline to the page
  5. Header compression for cookie-free domain HTTP /2 makes the transfer size of resources no longer an issue.