Skip to content

Instantly share code, notes, and snippets.

@vielhuber
Last active April 1, 2025 08:18
Show Gist options
  • Save vielhuber/0359de62c206334d68b53161873af9d1 to your computer and use it in GitHub Desktop.
Save vielhuber/0359de62c206334d68b53161873af9d1 to your computer and use it in GitHub Desktop.
echo output immediately in browser #php
<IfModule mod_deflate.c>
SetEnv no-gzip 1
</IfModule>
<?php
echo '1';
echo str_repeat(' ', 8192) . "\n"; // this must be sent since modern browsers buffer automatically
sleep(5);
echo '2';
echo str_repeat(' ', 8192) . "\n";
sleep(5);
echo '3';
echo str_repeat(' ', 8192) . "\n";
die();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment