What is the difference between HTTP/1.1 pipelining

2019-01-14 15:59发布

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.)

3条回答
相关推荐>>
2楼-- · 2019-01-14 16:41

HTTP/1.1 without pipelining: Each HTTP request over the TCP connection must be responded to before the next request can be made.

HTTP/1.1 with pipelining: Each HTTP request over the TCP connection may be made immediately without waiting for the previous request's response to return. The responses will come back in the same order.

HTTP/2 multiplexing: Each HTTP request over the TCP connection may be made immediately without waiting for the previous response to come back. The responses may come back in any order.

查看更多
劳资没心,怎么记你
3楼-- · 2019-01-14 16:42

I think to elaborate, both offer similar performance improvements.

However pipelining (or double buffering) is hampered by buggy proxies and sometimes buggy servers. So browsers stopped supporting it.

The solution is to use a completely new protocol HTTP/2. This has a few extra features, such as out of order return, header compression and server push, but it is unclear how much improvement they provide. The key issue is the bugs.

查看更多
我只想做你的唯一
4楼-- · 2019-01-14 16:46

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.

查看更多
登录 后发表回答