Launch browser for immediate partial reaction

When the HTTP response contains buffered output (i.e. s Transfer-Encoding: chunked

) and there is a delay between chunks, Chrome and Internet Explorer do not display the response until the entire response has been received. Firefox will display content as it arrives.

Try this test page in Firefox, then Chrome or IE.

Is there a way to get Chrome and Internet Explorer to display content as it receives it rather than waiting for a full response? Some kind of HTTP header perhaps?

+3


source to share


2 answers


The trick is to send a large chunk of data initially to force the browser to start rendering the output. In my testing, 1024 characters is enough to force Chrome to start rendering the response. IE10 doesn't respond until 4065 characters are received.



It's a bit of a hack but does the job.

+2


source


In Google Closure browser, the server sends a 290 byte string to force IE to display the content from the first snippet:



See "290 byte string 7cca694 ... e693af" at https://code.google.com/p/libevent-browserchannel-server/wiki/BrowserChannelProtocol

0


source







All Articles