When a user enters a URL in the browser and clicks enter, the browser issues the request to the server. There are several part to processing the request, DNS resolution, Connection to the server, waiting for the server to process,and downloading the HTML.
At some point the browser starts parsing and rendering the HTML and the JavaScri开发者_如何学运维pt. I was under the impression that this happened after the entire HTML is downloaded (so after last byte is in) - unless chunked encoding is being utilized by the server, in which case would be starting when first chunk is in (for example www.amazon.com).
However, recently I noticed on some URLs that the IE8 browser starts parsing the HTML some where in between the first and last byte of HTML. No chunked encoding on the response and the response was GZIpped.
So I am a little lost here. When does IE determine it can start parsing the HTML?
Even if it's not using chunked encoding, it still has to be transmitted as a series of TCP packets, and some servers will start sending them as soon as possible (like Apache). Almost every browser will start to parse the stream as soon as it starts to see it.
精彩评论