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

谁说胖子不能爱 提交于 2019-11-27 20:30:41

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!