0

I do understand that loading a script asynchronously doesn't affect the page loading time, in the sense that the browser doesn't wait for the script to be loaded before parsing the rest.

But does/could it affect the time it takes for the browser to start loading other(asynchronous) scripts?

If so, does it vary between browsers?

A developer of a site claimed that an asynchronous script resulted in a, in this case, 25ms delay before some other asynchronous script started to load.

joakimdahlstrom
  • 1,575
  • 1
  • 11
  • 23

2 Answers2

1

Yes, it could. Maximum simultaneous connections is one reason that an async load could affect loading speed of other resources. In short, the browser limits the number of resource downloads it does simultaneously so adding another async load may delay others.

  • This SO question & answers have much more details including numbers per different browser
  • This one discusses AJAX specifically and how loading from different domains is a possible workaround.
Community
  • 1
  • 1
sinelaw
  • 16,205
  • 3
  • 49
  • 80
  • According to your first link the browser limits per domain name. That must mean that you should see no delay when loading 100 files from different domains? – joakimdahlstrom Oct 30 '13 at 15:41
  • @joakimdahlstrom, apparently so, at least for some browsers. Since firefox limits to 2 connections per domain by default, you could easily test it by loading 10 files from different domains and tracking the connections in firebug. – sinelaw Oct 30 '13 at 16:02
0

use head.js

and you wont need to solve this question. sorry if its is not an answer for your question

Romko
  • 1,808
  • 21
  • 27