javascript

max number of concurrent file downloads in a browser?


Two related questions:

  1. What are the maximum number of concurrent files that a web page is allowed to open (e.g., images, css files, etc)? I assume this value is different in different browsers (and maybe per file type). For example, I am pretty sure that javascript files can only be loaded one at a time (right?).

  2. Is there a way I can use javascript to query this information?


Solution

  • For anyone wandering into this nearly 15 years later, this is a restriction browsers have for http/1, but isn't for http/2 or http/3. You can read a good article why here, and a discussion on the differences here.

    The TL;DR is that http/1 worked by creating separate TCP connections for separate requests. This could easily flood a webserver with tcp connections, and thus was capped. http/2 and http/3 don't work this way, and thus don't need the restriction.

    http/2 and http/3 do allow for limits by the server (not the browser), but it's usually very high (100s).