<?php
// Make sure PHP isn't buffereing anything.
ob_end_clean();
// Sending this header will prevent nginx from buffering the output.
header('X-Accel-Buffering: no');
header('Connection: KeepAlive');
header('Content-type: multipart/x-mixed-replace; boundary=endofsection');
// Keep in mind that the empty line is important to separate the headers
// from the content.
$i=1;
while(1){
echo 'Content-type: image/jpg
';
$stream = fopen("cache/1 ($i).jpg", 'rb');
fpassthru($stream);
fclose($stream);
//readfile("cache/2 ($i).jpg");
flush(); // Don't forget to flush the content to the browser.
echo '
--endofsection
';
usleep(200000);
$i++;
if($i==190)$i=1;
//break;
}
?>
// Make sure PHP isn't buffereing anything.
ob_end_clean();
// Sending this header will prevent nginx from buffering the output.
header('X-Accel-Buffering: no');
header('Connection: KeepAlive');
header('Content-type: multipart/x-mixed-replace; boundary=endofsection');
// Keep in mind that the empty line is important to separate the headers
// from the content.
$i=1;
while(1){
echo 'Content-type: image/jpg
';
$stream = fopen("cache/1 ($i).jpg", 'rb');
fpassthru($stream);
fclose($stream);
//readfile("cache/2 ($i).jpg");
flush(); // Don't forget to flush the content to the browser.
echo '
--endofsection
';
usleep(200000);
$i++;
if($i==190)$i=1;
//break;
}
?>