--- php-5.2.8/ext/zlib/zlib.c.orig	2008-08-01 22:36:59.000000000 -0400
+++ php-5.2.8/ext/zlib/zlib.c	2009-03-28 14:52:43.000000000 -0400
@@ -979,7 +979,7 @@
 {
 	zend_bool do_start, do_end;
 
-	if (!ZLIBG(output_compression)) {
+	if (!ZLIBG(output_compression) || SG(sapi_headers).http_response_code == 204 || SG(sapi_headers).http_response_code == 304) {
 		*handled_output = NULL;
 	} else {
 		do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0);
