Output Buffering with Varnish

Christoph Mitasch cmitasch at thomas-krenn.com
Fri Aug 31 16:39:11 CEST 2012


Hello,

I'm using Varnish 3.0.2-2~bpo60+1 on Debian Squeeze.

The following PHP code behaves differently when Varnish is used. The output is returned after 10 seconds at once. When Varnish is not used, an output is returned every second.
<?
echo "started";
for ($i=0;$i<10;$i++) {
 echo "+++";
 echo str_repeat(" ", 4096);
 sleep(1);
 flush();
 ob_flush();
}
echo "stopped";
?>

How can Varnish be configured that scripts making use of output buffering are working as expected?

Thank you,
Christoph



More information about the varnish-misc mailing list