0

I've been monitoring the Net panel of Firebug and noticed that the HTML has to be downloaded first before any other resources are downloaded. I guess this make sense since the other resources are defined in the HTML. Is there a way around this so that other components can be downloaded during the HTML download?

StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
  • It feels somewhat like you've answered your own question. The browser needs to retrieve all of the markup and begin parsing it before it knows what other resources are required. Do you mean instead how to optimize this process, using something like Facebook's BigPipe [1]? [1] http://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919 – jabley Nov 09 '10 at 13:12

3 Answers3

0

No - the browser needs a parseable HTML document first before it can start downloading scripts, images, etc.

You can speed up downloading of the non-HTML elements by moving them to different subdomains though: Browsers have a connections-per-host limit which is circumvented by using subdomains. Additionally you could compress/minify your CSS/JavaScript files to reduce their size.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
0

Debugging 101: what you see while debugging is different than what happens when you are not looking.

Most browsers start the HTML interpretation while downloading it, and start downloading the additional resources concurrently. Firebug is not a great place to see that happening, try HTTPFox instead.

Now, to answer your question: you don't need to do anything to make the browser download the other components while downloading your HTML, it'll take care of that for you.

Fábio Batista
  • 25,002
  • 3
  • 56
  • 68
0

There is the potential for one to create a small HTML file that then makes several requests to fill in the rest of the page through various AJAX-like calls, but if someone has JavaScript disabled then the page may look really bad. In a sense this is taking out some of the original HTML content and having it be downloaded separately which may or may not be a good idea. In a sense though this is using more network resources as there would be many requests to fully load the page in this case but it is a question of what is an acceptable trade-off.

JB King
  • 11,860
  • 4
  • 38
  • 49