Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.196
diff -u -F^f -r1.196 bootstrap.inc
--- includes/bootstrap.inc	17 Oct 2007 13:03:03 -0000	1.196
+++ includes/bootstrap.inc	22 Oct 2007 15:55:01 -0000
@@ -607,13 +607,15 @@ function drupal_page_cache_header($cache
   header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
   header("Cache-Control: must-revalidate");
 
-  // Determine if the browser accepts gzipped data.
-  if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE && function_exists('gzencode')) {
-    // Strip the gzip header and run uncompress.
-    $cache->data = gzinflate(substr(substr($cache->data, 10), 0, -8));
-  }
-  elseif (function_exists('gzencode')) {
-    header('Content-Encoding: gzip');
+  if (variable_get('compress_page_cache', TRUE)) {
+    // Determine if the browser accepts gzipped data.
+    if (@strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') === FALSE && function_exists('gzencode')) {
+      // Strip the gzip header and run uncompress.
+      $cache->data = gzinflate(substr(substr($cache->data, 10), 0, -8));
+    }
+    elseif (function_exists('gzencode')) {
+      header('Content-Encoding: gzip');
+    }
   }
 
   // Send the original request's headers. We send them one after
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.705
diff -u -F^f -r1.705 common.inc
--- includes/common.inc	22 Oct 2007 09:36:05 -0000	1.705
+++ includes/common.inc	22 Oct 2007 15:55:02 -0000
@@ -673,14 +673,15 @@ function fix_gpc_magic() {
  *   @endcode
  *
  * - @variable, which indicates that the text should be run through check_plain,
- *   to strip out HTML characters. Use this for any output that's displayed within
+ *   to escape HTML characters. Use this for any output that's displayed within
  *   a Drupal page.
  *   @code
  *     drupal_set_title($title = t("@name's blog", array('@name' => $account->name)));
  *   @endcode
  *
- * - %variable, which indicates that the string should be highlighted with
- *   theme_placeholder() which shows up by default as <em>emphasized</em>.
+ * - %variable, which indicates that the string should be HTML escaped and
+ *   highlighted with theme_placeholder() which shows up by default as
+ *   <em>emphasized</em>.
  *   @code
  *     $message = t('%name-from sent %name-to an e-mail.', array('%name-from' => $user->name, '%name-to' => $account->name));
  *   @endcode
@@ -2391,7 +2392,7 @@ function page_set_cache() {
     // This will fail in some cases, see page_get_cache() for the explanation.
     if ($data = ob_get_contents()) {
       $cache = TRUE;
-      if (function_exists('gzencode')) {
+      if (variable_get('compress_page_cache', TRUE) && function_exists('gzencode')) {
         // We do not store the data in case the zlib mode is deflate.
         // This should be rarely happening.
         if (zlib_get_coding_type() == 'deflate') {
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.15
diff -u -F^f -r1.15 system.admin.inc
--- modules/system/system.admin.inc	20 Oct 2007 21:57:50 -0000	1.15
+++ modules/system/system.admin.inc	22 Oct 2007 15:55:02 -0000
@@ -1189,6 +1189,13 @@ function system_performance_settings() {
     '#options' => $period,
     '#description' => t('On high-traffic sites it can become necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will go by before the cache is emptied and recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time. This setting also affects block caching.')
   );
+  $form['page_cache']['compress_page_cache'] = array(
+    '#type' => 'radios',
+    '#title' => t('Compress cache'),
+    '#default_value' => variable_get('compress_page_cache', TRUE),
+    '#options' => array(t('Disabled'), t('Enabled')),
+    '#description' => t("By default Drupal compresses the pages it caches. However, if the webserver also performs compression, it is not just unnecessary, it can also cause problems. So in this case this option should be set to Disabled."),
+  );
 
   $form['block_cache'] = array(
     '#type' => 'fieldset',
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.545
diff -u -F^f -r1.545 system.module
--- modules/system/system.module	21 Oct 2007 18:59:02 -0000	1.545
+++ modules/system/system.module	22 Oct 2007 15:55:02 -0000
@@ -942,7 +942,8 @@ function system_settings_form_submit($fo
   else {
     drupal_set_message(t('The configuration options have been saved.'));
   }
-
+  
+  cache_clear_all();
   drupal_rebuild_theme_registry();
 }
 
