页面中最大http请求数
浏览器在单个 html 页面中可以处理多少个 http 请求。 流行的说法是,浏览器只能处理来自单个域的特定 http 请求,因此最好创建静态域(cdn)。这样http请求就可以在2个域之间共享。
q1) 浏览器可以在单个 html 页面中处理多少个 http 请求或至少达到饱和点(例如 1000 个请求)?
q2)浏览器可以渲染多少个来自单个域名的http请求(假设来自同一域名的100个)?
还有任何关于最佳实践的建议!
How many http request does a browser can handle in a single html page.
Their is a popular saying that browser can handle only a certain http request from a single domain and so its better to create static domain(cdn). so that http request can be shared between the 2 domains.
q1)How many http request can a browser handle in a single html page or atleast the saturation point(say 1000 requests)?
q2)How many http request from a single domain name can a browser render(say 100 from the same domain name)?
also any suggestions for best practices!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
HTTP/1.1 RFC 第 8.1.4 节 说“单用户客户端不应与任何服务器或代理保持超过 2 个连接。”
然而,关键词是“应该”;大多数浏览器使用不同的数字。请参阅此博客了解最大连接数表每个浏览器的连接数。
Section 8.1.4 of the HTTP/1.1 RFC says a "single-user client SHOULD NOT maintain more than 2 connections with any server or proxy."
However, the key word is "should"; most browsers use a different number. See this blog for a table of max connections per browser.
理论上没有限制。但随着构建页面所需的请求数量增加,呈现页面所需的时间也会增加。在低计数情况下,该关系不是线性的。通常,延迟对实际吞吐量的影响比带宽大得多,HTTP 中有一些机制可以最大限度地减少这种影响,例如 keepalive 和并行请求。正如 Jon Grant 所说,并发请求的数量是有限制的。
这个问题的完整答案可以写满一本书 - 这是一个很好的答案。
In theory there is no limit. But as the number of requests required to construct a page grows, the time taken for the page to be rendered increases. The relationship is not linear at low counts. Typically latency has a far bigger effect than bandwidth on actual throughput and there are mechanisms in HTTP to minimise the effect of this - such as keepalives and parallel requests. As Jon Grant says, there are limits on the number of concurrent requests.
A full answer to this question would fill a book - here's a good one.