At 14:55 16-08-01, Troels Arvin wrote:
>On Thu, 16 Aug 2001 07:44:50 +0200, "John Donagher" <[EMAIL PROTECTED]>
> > So, we really want to disable output compression when we are serving
> > anything but HTML/text.
>I agree on that. I have heard that some older versions of both major
>browsers have trouble with compressed non-HTML content. - Or perhaps the
>ob_gzhandler could be given an argument telling it to be conservative or
>- Oh, and please:
>Could someone take a look at this bug which I really think is serious:
>As written, it's currently not possible to send proper Content-Length
>headers along with gz-encoded PHP-output because it's not possible to
>get the correct output-length information when using the gzhandler.
>When Content-Lengh headers are not sent, then Apache is not capable of
>using keep-alive == worse performance.
>There are lines like this in zlib.c:
>#if 0
>         } else {
>             char lenbuf[64];
>             sprintf(lenbuf,"Content-Length: %d",Z_STRLEN_P(return_value));
>             sapi_add_header(lenbuf,strlen(lenbuf), 1);
>What does "#if 0" actually mean?
>If it's too hard to change the output buffering system to return proper
>content lengths, maybe it would be an idea to be able to tell
>ob_end_flush() that you want a Content-Length header to be sent along?
>(It seems that ob_gzhandler knows the correct Content-Length but is
>unable to pass that information along to the output buffering system.)

The output buffering system knows how many bytes were returned, but it 
doesn't really matter, as all it does with the returned bytes, is print 
them out (the output buffering system itself is not programmable).

So, to summarize:

- Output compression should probably check that the content type is text/*, 
and not perform compression otherwise
- We can look into sending the content length header from the output 
compression callback

Can anybody think of good reasons not to send the content-length header in 
case we're performing output buffering?


PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to