Html 浏览器一次将从给定域下载多少资源?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9583172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How many resources will a browser download from a given domain at a time?
提问by rajakvk
Tried to figure out from firebug and by googling, didn't get any convincing answer.
试图从萤火虫和谷歌搜索中找出答案,没有得到任何令人信服的答案。
回答by Anmol Saraf
Nicely answered in this - thread
很好地回答了这个 -线程
IE7 allowed only two concurrent connections per host. But most browsers today allow more than that. IE8 allows 6 concurrent connections, Chrome allows 6, and Firefox allows 8.
So if your web page only has 6 images, for example, then it'd really be pointless to spread your images across multiple subdomains.
IE7 只允许每个主机有两个并发连接。但是今天的大多数浏览器允许的不止这些。IE8 允许 6 个并发连接,Chrome 允许 6 个,Firefox 允许 8 个。
因此,例如,如果您的网页只有 6 张图片,那么将您的图片分散到多个子域中真的毫无意义。
回答by Oded
It depends on the browser and how it is setup - firefox has controls for how many download threads to use, for example.
这取决于浏览器及其设置方式 - 例如,firefox 可以控制要使用的下载线程数。
The different browsers (and versions) have different defaults as well.
不同的浏览器(和版本)也有不同的默认值。
回答by kaushikb9
To avoid needlessly overloading servers, browsers limit the number of connections that can be made simultaneously. Depending on which browser, this limit may be as low as two connections per hostname. source : http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/
为了避免不必要的服务器过载,浏览器会限制可以同时建立的连接数。根据哪个浏览器,此限制可能低至每个主机名两个连接。来源:http: //encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/