Who is faster for connection: keep-alive and http/2 multiplexing in the case of concurrency?

background

I know that http/2 has a multiplexing mechanism in concurrency, and only one tcp is temporarily used no matter how many http requests there are. So there will be no request blocking.

the following figure shows multiple http requests in a tcp connection, with http/1.1 on the left and http/2
clipboard.png

on the right.

question

however, in the figure on the left, downloads style.css, and then script.js

only if there is request blocking .

We know that the maximum concurrency of requests in http/1.1 is generally 6, and there is no blocking when there are less than 6 requests.

so, if there are six http resource requests,

  1. download concurrently with http/1.1 6 tcp
  2. download concurrently with http/2 multiplexing a tcp, as well

which download is faster and why?


first of all, the http1.1 request in the same domain limits the establishment of six tcp connections. However, the TCP of each http1.1 is
, while http2 makes data requests based on the stream. Hundreds of requests can be delivered based on one tcp connection, and then spliced back to each request through the stream id. There is no header blocking and only one tcp, is used. The concurrency of the server has been increased by 6 times
and http2 also has header compression for Haverman coding compression of status line and header information, as well as static dictionary dynamic dictionary correlation and other technologies to save header information, optimize transmission, waste traffic

Menu