joakimdahlstrom
joakimdahlstrom

Reputation: 1595

Does an asynchronously loaded script affect the loading time of other scripts?

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.

Upvotes: 0

Views: 615

Answers (2)

sinelaw
sinelaw

Reputation: 16553

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.

Upvotes: 1

Romko
Romko

Reputation: 1798

use head.js

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

Upvotes: 0

Related Questions