开发者

why script downloads prevent parallelism in browsers

开发者 https://www.devze.com 2023-01-29 05:40 出处:网络
According to this link: \"If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. (I\'ve gotten Internet Explorer to download over 100 images in pa

According to this link:

"If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. (I've gotten Internet Explorer to download over 100 images in parallel.) While a script is downloading, however, the browser won’t start any other downloads, even on different hostnames."

What I wonder is why downloading script prevents parallel开发者_如何学运维ism? I guess browser executes the script right after the download finishes. So why not to download them in parallel, but defer only execution? Is it an implementation choice? Is there any other reason for that?


The browser executes the script as it is downloading it, so it will not get any further on the page to see what else there is that it needs to download. You can use something like LABjs to help with this though: http://labjs.com/

0

精彩评论

暂无评论...
验证码 换一张
取 消