0

After reading Steve Souders' 2008 blog post on HTTP connections per browser, it made me wonder if a browser can use both HTTP 1.0 and 1.1 when communicating with the same server while trying to render a webpage. I don't know a lot about the server technology involved or the HTTP specifications, so this question probably underscores my lack of understanding here.

4

1 回答 1

1

理论上,是的。HTTP 连接应该是无状态和独立的,一个好的服务器应该接受任何请求的组合。

例如,UA(或它前面的代理)可以首先尝试 HTTP/1.0 以查看它正在与哪个服务器通信,然后使用 1.1 发出后续请求(或先尝试 1.1 并在出错时降级到 1.0)。

实际上这不太可能,因为没有一个流行的 UA 做这样的事情,没有理由在 1.1 工作时使用 HTTP/1.0,而且真正的 HTTP/1.0 在 Web 上无论如何都不可用(“1.0”实际上意味着 1.1 没有分块编码并且connection:close默认情况下)。

在本文的上下文中:限制连接数只是规范中的一个建议,它并没有以任何方式在协议级别强制执行。HTTP/1.1 客户端通常会忽略规范的该部分,而不会降级协议版本。

于 2013-08-13T21:00:44.700 回答