Index: trunk/phase3/includes/OutputHandler.php |
— | — | @@ -76,9 +76,14 @@ |
77 | 77 | * @return string |
78 | 78 | */ |
79 | 79 | function wfGzipHandler( $s ) { |
80 | | - if( !function_exists( 'gzencode' ) || headers_sent() ) { |
| 80 | + if( !function_exists( 'gzencode' ) ) { |
| 81 | + wfDebug( __FUNCTION__ . "() skipping compression (gzencode unavaible)\n" ); |
81 | 82 | return $s; |
82 | 83 | } |
| 84 | + if( headers_sent() ) { |
| 85 | + wfDebug( __FUNCTION__ . "() skipping compression (headers already sent)\n" ); |
| 86 | + return $s; |
| 87 | + } |
83 | 88 | |
84 | 89 | $ext = wfRequestExtension(); |
85 | 90 | if( $ext == '.gz' || $ext == '.tgz' ) { |
— | — | @@ -90,6 +95,7 @@ |
91 | 96 | } |
92 | 97 | |
93 | 98 | if( wfClientAcceptsGzip() ) { |
| 99 | + wfDebug( __FUNCTION__ . "() is compressing output\n" ); |
94 | 100 | header( 'Content-Encoding: gzip' ); |
95 | 101 | $s = gzencode( $s, 6 ); |
96 | 102 | } |
Index: trunk/phase3/includes/cache/HTMLFileCache.php |
— | — | @@ -105,6 +105,7 @@ |
106 | 106 | |
107 | 107 | wfDebug( __METHOD__ . "()\n"); |
108 | 108 | $filename = $this->cachePath(); |
| 109 | + |
109 | 110 | $context->getOutput()->sendCacheControl(); |
110 | 111 | header( "Content-Type: $wgMimeType; charset=UTF-8" ); |
111 | 112 | header( "Content-Language: $wgLanguageCode" ); |
— | — | @@ -113,6 +114,7 @@ |
114 | 115 | header( 'Content-Encoding: gzip' ); |
115 | 116 | } else { |
116 | 117 | /* Send uncompressed */ |
| 118 | + wfDebug( __METHOD__ . " uncompressing cache file and sending it\n" ); |
117 | 119 | readgzfile( $filename ); |
118 | 120 | return; |
119 | 121 | } |