HTTP/2是否提高了每个主机的连接限制? [英] Is the per-host connection limit raised with HTTP/2?

查看:277
本文介绍了HTTP/2是否提高了每个主机的连接限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

浏览器对并行XHR的数量有一个主机限制(如今大约为6个).

Browsers have a per-host limit regarding number of parallel XHR (about 6 nowadays).

此限制是否适用于多路复用的HTTP/2连接?

推荐答案

浏览器在使用HTTP/1.1时对每个域施加6-8个连接限制,具体取决于浏览器的实现. 每个域最多允许6-8个并发请求.

Browsers impose a per-domain limit of 6-8 connections when using HTTP/1.1, depending on the browser implementation. This allows at most 6-8 concurrent requests per domain.

使用HTTP/2,浏览器每个域仅打开1个连接. 但是,由于HTTP/2协议具有多路复用功能,每个域的并发请求数不限于6-8,而实际上是无限的.

With HTTP/2, browsers open only 1 connection per domain. However, thanks to the multiplexing feature of the HTTP/2 protocol, the number of concurrent requests per domain is not limited to 6-8, but it is virtually unlimited.

实际上,浏览器和服务器可以通过SETTINGS_MAX_CONCURRENT_STREAMS"的HTTP/2配置参数.

It is virtually unlimited in the sense that browsers and servers may limit the number of concurrent requests via the HTTP/2 configuration parameter called SETTINGS_MAX_CONCURRENT_STREAMS.

典型限制在100左右(Firefox的network.http.spdy.default-concurrent默认值-请在此处注意spdy名称:它是HTTP/2协议的协议祖先),但可以更大(或更小,通常更小),取决于浏览器的实现方式以及所连接的服务器.

Typical limits are around 100 (Firefox's default value for network.http.spdy.default-concurrent - note the spdy name here: it was the protocol ancestor of the HTTP/2 protocol) but could be larger (or, less commonly, smaller), depending on browser implementation and on the server you connect to.

随着HTTP/2的发展和更广泛的使用,这些限制将随着时间的推移而变化(与HTTP/1.1相同):浏览器以2个连接开始,并在几年后达到6-8个连接使用,体验和调整).

Expect these limits to vary over the years with the evolution and the more widespread usage of HTTP/2 (in the same way it happened with HTTP/1.1: browsers started with 2 connections, and ended up to 6-8 after years of usage, experience and tuning).

我认为浏览器如何处理连接数和正常浏览并发XHR的并发请求之间没有任何区别,因此上面的解释也适用于XHR.

I don't think there is any difference between how a browser treats the number of connections and concurrent requests for normal browsing and for the usage of XHR, so the explanations above holds true for XHR as well.

这篇关于HTTP/2是否提高了每个主机的连接限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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