Why can browsers only download two or four compone

2019-06-04 02:21发布

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.

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?

1条回答
地球回转人心会变
2楼-- · 2019-06-04 02:54

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

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.

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.

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.

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

查看更多
登录 后发表回答