From e6cc8e9581807e21cf173c8a891869f1983fc935 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 22 Nov 2009 19:39:39 +0000 Subject: [PATCH] Now also deflate, but gzip first --- inc/functions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index d818478002..8f16dfc02a 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -170,12 +170,18 @@ function compileFinalOutput () { // Compress it? if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) { - // Compress it + // Compress it for HTTP gzip $GLOBALS['output'] = gzencode($GLOBALS['output'], 9, true); // Add header sendHeader('Content-Encoding: gzip'); - } // END - if + } elseif (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('deflate', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) { + // Compress it for HTTP deflate + $GLOBALS['output'] = gzcompress($GLOBALS['output'], 9); + + // Add header + sendHeader('Content-Encoding: deflate'); + } // Add final length sendHeader('Content-Length: ' . strlen($GLOBALS['output'])); -- 2.39.5