We have been using php flush to "blank" a page immediately as soon as it is clicked, and also to send the navigation and main components of the page so that a page appears nearly instantly, even though sometimes the content may take a long time to load.
This has been working very well.
Recently we upgraded from IIS 7.0 to 7.5 and now flush does not work. While investigating the problem we have turned off compression for both static and dynamic files. We have also turned off output caching.
We also have zlib compression turned off and output buffering off in php.ini.
In order to test the problem we have the following script
@ini_set("output_buffering", "Off");
@ini_set('implicit_flush', 1);
@ini_set('zlib.output_compression', 0);
ob_start();
echo "starting...<br/>
";
for($i = 0; $i < 5; $i++) {
print "$i<br/>
";
ob_end_flush();
ob_flush();
flush();
ob_start();
sleep(2);
}
print "DONE!<br/>
";
The browser just shows the loading status (whatever that is in any browser, in IE it looks like an Ajax animated gif, in Firefox the tab will say "Connecting...") for 10 seconds, and then suddenly the entire output appears.
We have tried various combinations of flush and ob_flush and ob_end_flush based upon similar questions on this site. None of them work. Is there any way to make IIS/PHP flush the data?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…