Bug #65115 [Opn]: flush() disables compression from ob_gzhandler
| From: | laruence@php.net | Date: | Tue, 25 Jun 2013 04:32:20 +0000 |
| Subject: | Bug #65115 [Opn]: flush() disables compression from ob_gzhandler | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-179770@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65115&edit=1
ID: 65115
Updated by: laruence@php.net
Reported by: preinheimer@php.net
Summary: flush() disables compression from ob_gzhandler
Status: Open
Type: Bug
Package: Output Control
Operating System: linux
PHP Version: 5.4.16
Block user comment: N
Private report: N
New Comment:
I encountered this problem too.
a workaround is don't use php's gzip handler, use the webserver's
Previous Comments:
------------------------------------------------------------------------
[2013-06-24 21:08:07] preinheimer@php.net
Description:
------------
Hi,
Consider the test script.
One might expect to see: Content-Encoding: gzip in the response headers, but it's not there. If
however you comment out that flush() compression is applied.
As a small amount of background, I work on two tools that help display data from the xhprof
extension. They both include flush(); ignore_user_abort(); before doing work to store the profiling
information in attempt to have as little impact on the user as possible. Clearly flush() wasn't
the safe command I thought it was, as it's having a large affect on the application I'm
profiling.
I'm prepared to write this up in the documentation, but I don't really think this is
expected behavior.
Test script:
---------------
<?php
ob_start('ob_gzhandler');
phpinfo();
flush();
Expected result:
----------------
output compressed
Actual result:
--------------
no compression
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65115&edit=1