ID: 42362 Updated by: ezy...@php.net -Summary: PHP sends GZIP empty data after a 304 response Reported By: ob dot php at daevel dot net -Status: Wont fix +Status: Open -Bug Type: HTTP related +Bug Type: Zlib Related Operating System: Debian Etch PHP Version: 5.2.3 New Comment:
I'm reopening this bug, under the contention that while PHP is not strictly at fault, it would be nice if it "did the right thing" when it noticed that output was empty, if only because gzipping nothing increases the size, not decrease it! Either that, or this is a documentation bug, in which case header() and/or zlib.output_compression should warn users that any HTTP status codes which are required to return no output must have zlib.output_compression turned off. Previous Comments: ------------------------------------------------------------------------ [2007-09-05 17:38:39] m...@php.net Well, the key issue is, zlib.output_compression and ob_gzhandler are not the same thing. Enabling zlib.output_compression starts the output handler without regard whether there's output or not unless you disable it again without sending output. ob_gzhandler is only initialized if there's been output. ------------------------------------------------------------------------ [2007-09-05 14:30:02] ob dot php at daevel dot net Yes of course if I disable the compression (with ini_set), there is not the problem. But is it really to the script to check and correct an internal behavior ? An old script which use ob_start( 'gz_handler' ) doesn't meet this "bug". ------------------------------------------------------------------------ [2007-09-04 12:33:58] j...@php.net AFAICT, you're sending the 304 in your script, it's not done by PHP. So in that case, isn't it your script that should turn off the compression? ------------------------------------------------------------------------ [2007-09-04 07:04:34] ob dot php at daevel dot net The RFC say : "The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields." Source : http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html (cf 10.3.5 "304 Not Modified" ) Actually PHP sent the "GZIP Magic Header" (I'm not talking about the HTTP headers, but the start of a gzip compressed data). ------------------------------------------------------------------------ [2007-08-27 11:07:01] j...@php.net How is this a bug when you tell in your request that you accept gzipped data? Of course you get that header then. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42362 -- Edit this bug report at http://bugs.php.net/?id=42362&edit=1