Search code examples
httphttp2multiplexingpipelining

What is the difference between HTTP/1.1 pipelining and HTTP/2 multiplexing?


Is it because it requires the responses to be made to client in the order of request that causes the head of line blocking problem in HTTP 1.1?

If each request takes exactly an equal amount of time, then there won't be head of line blocking and HTTP 1.1 pipelining and would perform same as that of HTTP/2 multiplexing?

(let's say there is no request priority in HTTP/2 requests and disregard other changes of HTTP/2 such as header compression, binary, etc.)


Solution

  • HTTP/1.1 pipelining still requires the requests to be returned in full, in the order requested.

    HTTP/2 allows the requests responses to be split into chunks and be returned in an intermingled fashion so avoiding head of line blocking.

    Additionally HTTP/1.1 pipelining never really took off and browser and server support is limited (see: https://en.m.wikipedia.org/wiki/HTTP_pipelining).

    But yes, in theory, they are similar and hence give similar performance benefits. HTTP/2 is just a better, more fully featured, more supported version of this - along with other benefits that you've noted.

    See also my answer here for a deeper discussion on HTTP/2 multiplexing: What does multiplexing mean in HTTP/2