--- admin_menu.module	2009-05-07 01:34:40.000000000 +0100
+++ admin_menu.module	2009-05-12 17:43:42.442214500 +0100
@@ -273,13 +273,13 @@
   // @todo According to http://www.mnot.net/blog/2006/05/11/browser_caching,
   //   IE will only cache the content when it is compressed.
   // Determine if the client accepts gzipped data.
-  if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && function_exists('gzencode')) {
-    if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) {
-      $encoding = 'gzip';
-    }
-    elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== FALSE) {
+  if (variable_get('page_compression', TRUE) && extension_loaded('zlib')) {
+    if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== FALSE) {
       $encoding = 'x-gzip';
     }
+    elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) {
+      $encoding = 'gzip';
+    }
     if (!empty($encoding)) {
       header('Vary: Accept-Encoding');
       header('Content-Encoding: ' . $encoding);
