Skip to content

Instantly share code, notes, and snippets.

@incomestore
Created June 18, 2015 19:13
Show Gist options
  • Save incomestore/eef7fc0d2d279395efd1 to your computer and use it in GitHub Desktop.
Save incomestore/eef7fc0d2d279395efd1 to your computer and use it in GitHub Desktop.
Output buffering in PHP on nginx
<?php
ob_implicit_flush(1);
for ($i = 0; $i < 10; $i++;)
{
@header("Content-Encoding: none");
echo $i;
//this is for the buffer achieve the minimum size in order to flush data
echo str_repeat(' ', 1024 * 64);
sleep(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment