htmlfirefoxbrowserbufferflush

Disable Recieving Buffer in Firefox (or other browsers)


I got trouble with web browsers buffering (not chaching).

I call this php script :

sleep(5);
echo '1st step';
echo (str_repeat(' ',256));
sleep(5);
echo '<br />';
echo '2nd step';

output buffer is disabled on php (we will confirm that later)

when calling this script with both Chromium 12 and Firefox 5 I got this result :

the 'waiting' animated circle (the grey one) runs during ~5sec then the 'transferring' animated circle (the orange one) runs during ~5sec and finally i have the whole result displayed.

My initial goal was, as you expect, to wait 5sec, then see "1st step" displayed, wait 5sec again and then see "2nd step" displayed.

clues

Any idea ?

Thanks,


Solution

  • Oh, I guess I need to make the answer an answer, not a comment, so you can accept it.

    The HTML5 charset sniffing buffer size is 512 bytes. So the response needs to either have 512 bytes of padding or set a charset (via <meta> tag or HTTP header).