merged branch pounard/master (PR #4914)

Commits
-------

7d53909 Earlier PHP output buffer flush for non FPM environments

Discussion
----------

Earlier PHP output buffer flush for non FPM environments

In the Response::send() method you are calling the fastcgi_finish_request() in case it exists. This will provide a respectful performance boost when you have significant work being done by listeners acting on kernel terminal events; Sadly you are forgetting people that don't use FPM doing this.

The performance boost for a Vanilla PHP is not much: flushing earlier potentially helps higher layers such as the HTTPd or potential other cache layers: the sooner their buffer gets filled, the sooner they release information to the browser, even if the output buffer is still open. The explicit flush() is supposed to do exactly this.
This commit is contained in:
Fabien Potencier 2012-07-15 09:29:03 +02:00
commit 4513210276
1 changed files with 5 additions and 0 deletions

View File

@ -299,6 +299,11 @@ class Response
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
} else {
while (0 < ob_get_level()) {
ob_end_flush();
}
flush();
}
return $this;