File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -608,11 +608,10 @@ public function shutdown(): void
608608 // Unfortunately without FastCGI there is no way to force close the connection.
609609 // We need to ask browser to close the connection for us.
610610
611- // With zlib.output_compression enabled, PHP handles compression automatically.
612- // We cannot set Content-Length when compression is active (size unknown until compressed).
613- if (!$ config ->get ('system.cache.gzip ' ) && !ini_get ('zlib.output_compression ' )) {
614- if ($ config ->get ('system.cache.allow_webserver_gzip ' )) {
615- // Let web server to do the hard work.
611+ // Check if external compression is active (e.g., zlib.output_compression in php.ini).
612+ if (!ini_get ('zlib.output_compression ' )) {
613+ if ($ config ->get ('system.cache.gzip ' ) || $ config ->get ('system.cache.allow_webserver_gzip ' )) {
614+ // Let web server handle compression.
616615 header ('Content-Encoding: identity ' );
617616 } elseif (function_exists ('apache_setenv ' )) {
618617 // Without gzip we have no other choice than to prevent server from compressing the output.
Original file line number Diff line number Diff line change @@ -345,12 +345,6 @@ protected function initializeOutputBuffering(Config $config): void
345345
346346 // Use output buffering to prevent headers from being sent too early.
347347 ob_start ();
348- if ($ config ->get ('system.cache.gzip ' )) {
349- // Try to use zlib.output_compression instead of ob_gzhandler (more robust)
350- if (!ini_get ('zlib.output_compression ' ) && !headers_sent ()) {
351- ini_set ('zlib.output_compression ' , '4096 ' );
352- }
353- }
354348
355349 $ this ->stopTimer ('_init_ob ' );
356350 }
You can’t perform that action at this time.
0 commit comments