HTTP管道和使用SPDY进行HTTP多路复用之间的区别 [英] Difference between HTTP pipeling and HTTP multiplexing with SPDY

查看:185
本文介绍了HTTP管道和使用SPDY进行HTTP多路复用之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢Google和Stack Overflow,我想我理解常规HTTP流水线和HTTP多路复用之间的区别(例如,使用SPDY),因此我在下面的图表中显示了基于三个常规HTTP请求的流水线和多路复用之间的差异。

Thanks to Google and Stack Overflow, I think I understood the difference between regular HTTP pipelining and HTTP multiplexing (e.g., with SPDY), so I made the diagram below to show the differences between pipelining and multiplexing based on three regular HTTP requests.

我的两个问题是:


  1. 图像是否正确?

  2. 如果流水线操作没有,那是真的吗?线头阻塞问题它会像HTTP多路复用一样快吗?或者我是否错过了额外的差异?

  1. Is the image correct?
  2. Is it true that if pipelining would not have the head-of-line blocking problem it would be as fast as HTTP multiplexing? Or did I miss an additional difference?


推荐答案

这不是不正确的,但有一个重要的方面它省略了。 HTTP要求您在继续执行任何其他请求之前提供整个响应。您在图表中显示的内容是正确的,因为使用SPDY,我们最终可以打破行首要求并在响应可用时提供响应。但是,我们也不必等待任何请求完全完成。

It's not incorrect, but there is an important aspect it omits. HTTP requires that you deliver the entire response before any other request can proceed. What you're showing in the diagram is correct in the sense that with SPDY we can finally break the "head of line" requirement and deliver the responses as they become available. However, we also don't have to wait for any request to complete entirely.

想象一下两个请求,大小都是几个kb:每个请求都有多个数据包,称之为 [r1p1,r1p2] [r2p1,r2p2] 。 HTTP要求pN以准确的顺序到达。另一方面,SPDY允许我们进行以下操作: [r2p1,r1p1,r1p2,r2p2]

Imagine two requests, both several kb's in size: each request will have multiple packets, call them [r1p1, r1p2] and [r2p1, r2p2]. HTTP requires that pN's arrive in exact order. SPDY, on the other hand allows us the following: [r2p1, r1p1, r1p2, r2p2].

值得一提的是,使用SPDY,我们可以使用请求优先级来提示服务器哪些请求应该优先,即使它稍后到达网络(半打之中)其他很棒的功能)。

It's also worth mentioning that with SPDY we can use request priorities to hint the server which requests should take precedence, even if it arrives later on the wire (amongst half a dozen other great features).

这篇关于HTTP管道和使用SPDY进行HTTP多路复用之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆