]> git.mxchange.org Git - mailer.git/commitdiff
Now also deflate, but gzip first
authorRoland Häder <roland@mxchange.org>
Sun, 22 Nov 2009 19:39:39 +0000 (19:39 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Nov 2009 19:39:39 +0000 (19:39 +0000)
inc/functions.php

index d81847800247afa6b9d8babb914eee11fe86bf88..8f16dfc02a44ac1f7a4583722005bce6404b7573 100644 (file)
@@ -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']));