For more information see Netscape's page on server-push.
Update 20020108: Poked around freshmeat for a bit and found Andy Wilcock's Cambozola java applet which seems to work well with my php script to make the stream viewable under IE. Beware that the current version doesn't work under "Name-based" virtual hosts but I'll have a patch for it soon.
<?
header('Content-type: text/plain');
print <<<EOF
<?
\$file = "./latest.jpg";
\$sep = "gIrLsKiCkAsSiTsAySsOoNaTsHiRt";
if (ereg(".*MSIE.*",\$HTTP_SERVER_VARS["HTTP_USER_AGENT"]))
{
# If IE, spit out one pic and exit
header("Cache-Control: no-cache");
header("Pragma: no-cache");
header("Content-type: image/jpeg");
header("Content-size: " . filesize(\$file));
readfile($file);
}
else
{
# if not IE, give the browser a try
header("Content-Type: multipart/x-mixed-replace; boundary=\\$sep");
print "--\$sep\\n";
do {
print "Content-Type: image/jpeg\\n\\n";
readfile(\$file);
print "\\n--\$sep\\n";
flush();
\$mt = filemtime(\$file);
do {
sleep (1);
# we won't output the same image twice.
clearstatcache();
} while (\$mt == filemtime(\$file));
} while (1);
}
?>
EOF;
?>
Make sure there are no blank lines outside the <? ?> in your script. That will cause screwey headers to be sent too soon.
Reference the script in your HTML page as if it was an image:
<IMG SRC="server-push.php" HEIGHT=240 WIDTH=320>
Use this bit of PHP on the page that references the image to compensate for IE's lack of "innovation":
<HEAD>
<?
if (ereg("MSIE",$HTTP_SERVER_VARS["HTTP_USER_AGENT"])) {
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"4;\">\n";
}
?>
</HEAD>