Edit report at https://bugs.php.net/bug.php?id=65115&edit=1

 ID:                 65115
 Updated by:         larue...@php.net
 Reported by:        preinhei...@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] preinhei...@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

Reply via email to