mirror of
https://github.com/getgrav/grav.git
synced 2026-07-11 02:33:41 +02:00
don’t do internal gzip, rely on webserver
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -608,11 +608,10 @@ class Grav extends Container
|
||||
// Unfortunately without FastCGI there is no way to force close the connection.
|
||||
// We need to ask browser to close the connection for us.
|
||||
|
||||
// With zlib.output_compression enabled, PHP handles compression automatically.
|
||||
// We cannot set Content-Length when compression is active (size unknown until compressed).
|
||||
if (!$config->get('system.cache.gzip') && !ini_get('zlib.output_compression')) {
|
||||
if ($config->get('system.cache.allow_webserver_gzip')) {
|
||||
// Let web server to do the hard work.
|
||||
// Check if external compression is active (e.g., zlib.output_compression in php.ini).
|
||||
if (!ini_get('zlib.output_compression')) {
|
||||
if ($config->get('system.cache.gzip') || $config->get('system.cache.allow_webserver_gzip')) {
|
||||
// Let web server handle compression.
|
||||
header('Content-Encoding: identity');
|
||||
} elseif (function_exists('apache_setenv')) {
|
||||
// Without gzip we have no other choice than to prevent server from compressing the output.
|
||||
|
||||
@@ -345,12 +345,6 @@ class InitializeProcessor extends ProcessorBase
|
||||
|
||||
// Use output buffering to prevent headers from being sent too early.
|
||||
ob_start();
|
||||
if ($config->get('system.cache.gzip')) {
|
||||
// Try to use zlib.output_compression instead of ob_gzhandler (more robust)
|
||||
if (!ini_get('zlib.output_compression') && !headers_sent()) {
|
||||
ini_set('zlib.output_compression', '4096');
|
||||
}
|
||||
}
|
||||
|
||||
$this->stopTimer('_init_ob');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user