Faster Loading Web Pages
Tuesday September 2, 2008
Web Browsers limit the number of files they download simultaneously from the one domain. When a JavaScript file is referenced from HTML the limit is reduced to ONE.
Older web browsers will only download at most two files at a time from the same domain while downloading a page into the browser. More modern browsers have increased this limit to six. This makes no difference when a <script> tag is reached in the HTML though. All browsers will stop downloading any other files while the JavaScript file is downloaded and run. The reason behind this logic is that the JavaScript code when run may generate a result that means that the rest of the page doesn't need to be downloaded (such as if it sets a new location value).
We can significantly speed the loading of our web pages if we get rid of this single threading of JavaScript files. The limit only applies to file downloads triggered by HTML. If we trigger the JavaScript downloads from JavaScript then they will be carried out totally separately from the HTML requests allowing the JavaScript to be downloaded simultyaneously with (or after) the rest of the web page.
Faster Loading Web Pages


No comments yet. Leave a Comment