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?
- Single connection Each page establishes only one TCP connection until the page is closed, reducing the cost of connection establishment.
- Multiplexing Multiple requests can be made simultaneously on a connection
- Server push
- Priority Assigns priority to requests, and the server responds first to requests of higher priority.
- Binary HTTP /2 is in binary form, which is easier for the server to parse and saves text conversion time.
- Header compression reduces the repeated passing of duplicate header data in HTTP1.1, greatly reducing the size of bytes transmitted.
What are the benefits?
- Google says that sites that support HTTP /2 will be high on SEO
- Reduce TCP connections and reduce server overhead.
- Faster website
support
- HTTP /2 is backward compatible. If HTTP /2 is not supported, the switch is automatically switched to HTTP /1.1.
- 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:
- Domain name subdivision
- Image sprites
- File merging
- Inline files CSS, JS, and image files no longer need to be inline to the page
- Header compression for cookie-free domain HTTP /2 makes the transfer size of resources no longer an issue.