为什么浏览器只能并行下载两个或四个组件? [英] Why can browsers only download two or four components in parallel?

查看:162
本文介绍了为什么浏览器只能并行下载两个或四个组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道减少HTTP请求的数量会减少用户的页面加载时间,因为浏览器只能加载"

I know that reducing the number of HTTP requests decreases the page load time for users because browsers can only load "two or four" components in parallel per host name.

但是我似乎无法在任何地方找到有关为什么浏览器只能按主机名并行下载两个或四个"组件的信息!这是HTTP浏览器的限制吗?

But I can't seem to find information anywhere about WHY browsers can only download "two or four" components in parallel per host name!? Is this a limitation of the browsers of HTTP?

推荐答案

RFC 2616超文本传输​​协议-HTTP/1.1"(

It's covered in RFC 2616, "Hypertext Transfer Protocol -- HTTP/1.1" (http://www.ietf.org/rfc/rfc2616.txt)

使用持久连接的客户端应该限制它们与给定服务器维护的同时连接数.单用户客户端不应与任何服务器或代理保持2个以上的连接.代理最多应使用2 * N个连接到另一个服务器或代理的连接,其中N是同时活动用户的数量.这些准则旨在缩短HTTP响应时间并避免拥塞.

Clients that use persistent connections SHOULD limit the number of simultaneous connections that they maintain to a given server. A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy. A proxy SHOULD use up to 2*N connections to another server or proxy, where N is the number of simultaneously active users. These guidelines are intended to improve HTTP response times and avoid congestion.

您还必须记住该RFC是在1999年编写的,当时我们的服务器,网络工具包等功能远不如以前.

You've also got to remember this RFC was written in 1999, in a day where we had far less powerful servers, networking kit etc.

现在大多数浏览器支持两个以上的连接,其中六个很常见.

Most browsers now support more than two connections with six being very common.

请参见 http://www .browserscope.org/?category = network ,如果要获取与浏览器支持的主机名的并行连接数的最新列表.

See http://www.browserscope.org/?category=network if you want an up-to-date list of the number of parallel connections to a hostname that browsers support.

您可能还想读一下吉姆·盖蒂(Jim Getty)关于缓冲区膨胀"的内容,这可能会使并行连接变得更糟.

You might also want to read-up some of Jim Getty's stuff on 'buffer bloat' which parallel connections can make worse.

这篇关于为什么浏览器只能并行下载两个或四个组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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