Maximum number of simultaneous file downloads in a browser?

Two related questions:

  • What is the maximum number of parallel files allowed to open a web page (e.g. images, css files, etc.)? I assume that this value is different in different browsers (and possibly by file type). For example, I'm sure that javascript files can only be loaded one at a time (right?).

  • Is there a way to use javascript to request this information?

+1
source share
6 answers

One interesting way to bypass X connections on the server limit is to map static resources, such as scripts and images, to their own domains ... img.foo.com or js.foo.com.

I just read about it - I really haven't tried it. So please let me know if this does not work.

+5
source

For Internet Explorer, see this MSDN article . In principle, if the user has not edited the registry or completed the "Internet Acceleration" program, they will have a maximum of two connections when using IE7 or earlier. IE8 tries to be smart and can create up to 6 simultaneous connections, depending on the server and the type of Internet connection. In JavaScript on IE8, you can request the window.maxConnectionsPerServer property.

For Firefox, the default value is 2 for FF2 and earlier, and for FF3 - 6. See the Mozilla Documentation . I generally donโ€™t know how to extract this value from JavaScript in FF.

Most HTTP servers do not have the ability to limit the number of connections from one host, except for IP prohibition. In general, this is not a good idea, since many users are behind a proxy server or NAT router, which allows you to use multiple connections from the same IP address.

On the client side, you can artificially increase this amount by requesting resources from multiple domains. You can configure www1, www2, etc. An alias that points to the same web server. Then shuffle where the static content is retrieved. This will result in a small overhead for the first time due to additional DNS resolution.

+6
source
  • This is a limitation of both the server and the browser. Common network etiquette claims that no more than 4 simultaneous connections are allowed. By default, most servers allow a maximum of 2 connections, and most browsers follow this example. Most of them are customizable.
  • Not.
+1
source

The limitation is usually a web server. It is well known that a web server allows only two simultaneous downloads for each user.

Active scripting, such as ASP.NET, only performs one request at a time for each user. Requests for static files are not processed by the script engine, so you can get, for example, an image by receiving an aspx file.

Pages often have content from different servers, for example, scripts to measure traffic, etc. Since there is a download limit for each server, you can download two files from each server at once.

Since this is a server limitation, you cannot learn anything about it using javascript.

+1
source

I know, at least in Firefox, this value is configurable ( network.http.max-connections , network.http.max-connections-per-server and network.http.pipelining.maxrequests ), so I doubt that you will get final answer to this question. The default value is 4.

What are you trying to accomplish?

0
source

There is nothing in HTTP that limits the number of sessions.

However, in FF there are configuration items for one that specify the number of shared sessions and the number of sessions on a single server. Other browsers may also have this feature.

In addition, the server can limit the number of sessions completely and from each client IP address.

So the correct answer is:

1 / The number of sessions is limited by the minimum imposed by the client (browser) and server.

2 / Because of this, there is no reliable way to query in JavaScript.

0
source

All Articles