Answer the question
In order to leave comments, you need to log in
What could be the difference between two servers handling buffer flushes differently in php?
The point is this. There are two servers, here are their versions:
1. PHP 5.4.45 (cli) (built: Jun 17 2016 17:55:12)
2. PHP 5.5.30-1~dotdeb+7.1 (cli) (built: Oct 1 2015 17:38:39)
header("HTTP/1.1 200 OK");
header("Connection: close");
ob_start();
echo __FILE__."<br>";
$size = ob_get_length();
header("Content-Length: $size");
sleep(2);
ob_end_flush();
flush();
sleep(2);
phpinfo();
<IfModule mod_php5.c>
# disable compressing
php_flag zlib.output_compression off
SetEnv no-gzip 1
</IfModule>
<FilesMatch \.php$>
SetEnv no-gzip 1
</FilesMatch>
<IfModule mod_deflate.c>
RemoveOutputFilter DEFLATE html txt xml css js php
</IfModule>
Options -Indexes
Answer the question
In order to leave comments, you need to log in
Well, the study of manuals and tests made themselves felt. Here is the code that worked as it should:
header("HTTP/1.1 200 OK");
header("Connection: close");
ob_start();
phpinfo();
$size = ob_get_length();
header("Content-Length: $size");
ob_flush();
sleep(2);
echo __FILE__."<br>";
<FilesMatch \.php$>
SetEnv no-gzip 1
</FilesMatch>
You approached the problem from the wrong side.
When you receive a request from a user, you simply save it to the queue.
And you process such requests as a background process.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question