Created
January 22, 2009 19:26
-
-
Save wizardishungry/50681 to your computer and use it in GitHub Desktop.
Server push solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
@apache_setenv('no-gzip', 1); | |
@ini_set('zlib.output_compression', 0); | |
@ini_set('implicit_flush', 1); | |
function hardFlush() { | |
flush(); | |
ob_flush(); | |
} | |
header('Content-type: multipart/x-mixed-replace;boundary="rn9012"'); | |
for($i=0;$i<=10;$i++) | |
{ | |
print "--rn9012\n"; | |
echo "Content-Type: text/html\n\n"; | |
echo "<html>$i"; | |
echo '<!--',str_repeat(' ',1024),'-->'; | |
echo "</html>"; | |
hardFlush(); | |
sleep(1); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment