Okay, I've created a minimal test case for the problem:
<?php function showCompressed( $phantom = "" ) { $compressed = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xf3\xc8\x54\x54\xf0\x54" . "\xcf\x55\x48\x54\x48\xce\xcf\x2d\x28\x4a\x2d\x2e\x4e\x4d\x51\x28" . "\x2e\x29\xca\xcc\x4b\x07\x00\x46\xa1\x81\x5a\x1b\x00\x00\x00"; header( "Content-encoding: gzip" ); return $compressed; } ob_start( "showCompressed" ); print "This is throwaway text."; flush(); ?>
On the Apache 1.3.x setups I've tested this on, it works fine: a browser recognizes the encoding and prints out "Hi! I'm a compressed string". On my Apache 2.0.x setups, the content-encoding header is not sent and the browser prints out binary gibberish.
If I remove the flush() call or change it to ob_flush(), then the headers are sent out correctly and the browser decodes the string.
The purpose of the flush() (which is at the end of OutputPage::output()) is to ensure that actual page output is completed before the 'deferred updates' run, so the user doesn't have to wait for them to complete before they can start reading. This isn't really vital and could probably be accomplished by using ob_start()/ob_flush() anyway.
-- brion vibber (brion @ pobox.com)