? boost-413908.patch
Index: boost.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.admin.inc,v
retrieving revision 1.1.2.1.2.3.2.32
diff -u -p -r1.1.2.1.2.3.2.32 boost.admin.inc
--- boost.admin.inc	18 Jun 2009 08:44:07 -0000	1.1.2.1.2.3.2.32
+++ boost.admin.inc	19 Jun 2009 10:00:47 -0000
@@ -22,13 +22,13 @@ function boost_admin_settings($form = ar
 
   // Set text
   $description_core = '<p>'. t("The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive cache mode causes Drupal to skip the loading (boot) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.") .'</p>';
-  $problem_modules = array_diff(array_unique(array_merge(module_implements('boot'), module_implements('exit'))), array(0 => 'boost'));
+  $problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit')));
   sort($problem_modules);
   if (count($problem_modules) > 0) {
-    $description .= '<p>'. t('<strong class="error">The following enabled modules are incompatible with aggressive mode caching and will probably not function properly: %modules</strong>', array('%modules' => implode(', ', $problem_modules))) .'.</p>';
+    $description_core .= '<p>'. t('<strong class="error">The following enabled modules are incompatible with aggressive mode caching and will probably not function properly: %modules</strong>', array('%modules' => implode(', ', $problem_modules))) .'.</p>';
   }
   else {
-    $description .= '<p>'. t('<strong class="ok">Currently, all enabled modules are compatible with the aggressive caching policy.</strong> Please note, if you use aggressive caching and enable new modules, you will need to check this page again to ensure compatibility.') .'</p>';
+    $description_core .= '<p>'. t('<strong class="ok">Currently, all enabled modules are compatible with the aggressive caching policy.</strong> Please note, if you use aggressive caching and enable new modules, you will need to check this page again to ensure compatibility.') .'</p>';
   }
   $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 64800, 86400, 2*86400, 3*86400, 4*86400, 5*86400, 6*86400, 604800, 2*604800, 3*604800, 4*604800, 8*604800, 16*604800), 'format_interval');
   $period[0] = '<' . t('none') . '>';
@@ -57,9 +57,14 @@ function boost_admin_settings($form = ar
   );
   $form['boost']['boost_clear'] = array(
     '#type' => 'submit',
-    '#value' => t('Clear Boost cached data: !count pages', array('!count' => boost_count_db())),
+    '#value' => t('Clear ALL Boost cached data: !count pages', array('!count' => boost_count_db(TRUE))),
     '#submit' => array('boost_clear_cache_submit'),
   );
+  $form['boost']['boost_clear_expired'] = array(
+    '#type' => 'submit',
+    '#value' => t('Clear Boost expired data: !count pages', array('!count' => boost_count_db(FALSE))),
+    '#submit' => array('boost_clear_expired_cache_submit'),
+  );
 
   // Cacheability settings
   // TODO: update to use Drupal 6.x core code.
@@ -139,6 +144,18 @@ function boost_admin_settings($form = ar
      '#default_value' => BOOST_CACHE_XML,
      '#description'   => t('Boost will cache .xml and /feed urls as xml data.'),
    );
+   $form['boost']['advanced']['boost_cache_css'] = array(
+     '#type'          => 'checkbox',
+     '#title'         => t('Cache .css'),
+     '#default_value' => BOOST_CACHE_CSS,
+     '#description'   => t('Boost will cache CSS files.'),
+   );
+   $form['boost']['advanced']['boost_cache_js'] = array(
+     '#type'          => 'checkbox',
+     '#title'         => t('Cache .js'),
+     '#default_value' => BOOST_CACHE_JS,
+     '#description'   => t('Boost will cache javascript files.'),
+   );
   $form['boost']['advanced']['boost_only_ascii_path'] = array(
     '#type'          => 'checkbox',
     '#title'         => t('Only allow ASCII characters in path'),
@@ -169,6 +186,13 @@ function boost_admin_settings($form = ar
     '#default_value' => BOOST_MULTISITE_SINGLE_DB,
     '#description'   => t('If Drupal is running on a multi-site with a single/shared database, then enabling this will allow for correct multi-site caching.'),
   );
+  $form['boost']['advanced']['boost_ignore_flush'] = array(
+    '#type'          => 'radios',
+    '#title'         => t('Ignore cache flushing'),
+    '#default_value' => BOOST_IGNORE_FLUSH,
+    '#options'       => array(0 => t('Disabled'), 1 => t('Only Ignore Complete Fushes'), 2 => t('Ignore All Delete Commands (Not Recommended)')),
+    '#description'   => t('Enable to put your site into a static state. Recommend turning on CSS & JS caching.'),
+  );
   $form['boost']['advanced']['boost_reset'] = array(
     '#type' => 'submit',
     '#value' => t('Reset boost database'),
@@ -257,11 +281,12 @@ function boost_admin_settings_submit($fo
   extract($form_state['values'], EXTR_SKIP | EXTR_REFS);
 
   if (empty($boost_enabled) && !empty($boost_previously)) { // the cache was previously enabled
+    variable_set('boost_ignore_flush', 0);
     if (boost_cache_clear_all()) {
       drupal_set_message(t('Static page cache cleared.'));
     }
   }
-  else if (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE) {
+  else if ((variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE) && BOOST_IGNORE_FLUSH == 0) {
     boost_cache_clear_all();
   }
 }
@@ -283,13 +308,13 @@ function boost_admin_site_offline_submit
 }
 
 function boost_admin_modules_submit($form, &$form_state) {
-  if (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE) {
+  if (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE && BOOST_IGNORE_FLUSH == 0) {
     boost_cache_clear_all();
   }
 }
 
 function boost_admin_themes_submit($form, &$form_state) {
-  if (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE) {
+  if (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE && BOOST_IGNORE_FLUSH == 0) {
     boost_cache_clear_all();
   }
 }
@@ -316,6 +341,8 @@ function boost_admin_generate_htaccess($
   $document_root = str_replace($drupal_subdir, '', $document_root );
   $html = '\\' . $html;
   $xml = '\\' . $xml;
+  $css = '\\.css';
+  $js = '\\.js';
   $gz = '\\.gz';
 
   $string = <<<ETO
@@ -327,35 +354,51 @@ function boost_admin_generate_htaccess($
     </IfModule>
   </FilesMatch>
   <IfModule mod_mime.c>
-    AddCharset utf-8 $html
-    AddCharset utf-8 $xml
+    AddCharset utf-8 .html
+    AddCharset utf-8 .xml
   </IfModule>
-  AddEncoding x-gzip $gz
+  AddEncoding x-gzip .gz
   <FilesMatch "$html$gz$">
     ForceType text/html
   </FilesMatch>
   <FilesMatch "$xml$gz$">
     ForceType text/xml
   </FilesMatch>
+  <FilesMatch "$css$gz$">
+    ForceType text/css
+  </FilesMatch>
+  <FilesMatch "$js$gz$">
+    ForceType text/javascript
+  </FilesMatch>
 
   # Skip boost IF not get request OR uri has wrong dir OR cookie is set
   RewriteCond %{REQUEST_METHOD} !^GET$ [OR]
   RewriteCond %{REQUEST_URI} (^$drupal_subdir(admin|cache|misc|modules|sites|system|themes))|(/(comment/reply|user|user/(login|password|register))$) [OR]
   RewriteCond %{HTTP_COOKIE} DRUPAL_UID
-  RewriteRule .* - [S=4]
+  RewriteRule .* - [S=9]
 
   # GZIP
-  RewriteCond %{HTTP:Accept-encoding} gzip
+  RewriteCond %{HTTP:Accept-encoding} !gzip
+  RewriteRule .* - [S=4]
+
   RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$html$gz -s
   RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$html$gz [L,T=text/html]
   RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$xml$gz -s
   RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$xml$gz [L,T=text/xml]
+  RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_$css$gz -s
+  RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_$css$gz [L,QSA,T=text/css]
+  RewriteCond $document_root$drupal_subdir/$cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_$js$gz -s
+  RewriteRule .* $cache_dir/$gzip_dir/$server_name%{REQUEST_URI}_$js$gz [L,QSA,T=text/javascript]
 
   # NORMAL
   RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$html -s
   RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$html [L,T=text/html]
   RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$xml -s
   RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}_%{QUERY_STRING}$xml [L,T=text/xml]
+  RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}_$css -s
+  RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}_$css [L,QSA,T=text/css]
+  RewriteCond $document_root$drupal_subdir/$cache_dir/$server_name%{REQUEST_URI}_$js -s
+  RewriteRule .* $cache_dir/$server_name%{REQUEST_URI}_$js [L,QSA,T=text/javascript]
   ### BOOST END ###
 ETO;
 
@@ -367,10 +410,10 @@ return $string;
  */
 function boost_count_db($all = FALSE) {
   if ($all) {
-    return db_result(db_query("SELECT COUNT(*) FROM {boost_cache}"));
+    return db_result(db_query("SELECT COUNT(*) FROM {boost_cache} WHERE expire <> 0"));
   }
   else {
-    return db_result(db_query("SELECT COUNT(*) FROM {boost_cache} WHERE expire <> 0"));
+    return db_result(db_query('SELECT COUNT(*) FROM {boost_cache} WHERE expire BETWEEN 1 AND %d', BOOST_TIME));
   }
 }
 
@@ -389,6 +432,15 @@ function boost_clear_cache_submit () {
   drupal_set_message(t('Boost page cache cleared.'));
 }
 
+
+/**
+ * Flushes all expired pages from database
+ */
+function boost_clear_expired_cache_submit () {
+  boost_cache_db_expire();
+  drupal_set_message(t('Expired stale files from static page cache.'));
+}
+
 /**
  * Flushes core page cache
  */
Index: boost.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.install,v
retrieving revision 1.2.2.1.2.3.2.14
diff -u -p -r1.2.2.1.2.3.2.14 boost.install
--- boost.install	18 Jun 2009 22:45:32 -0000	1.2.2.1.2.3.2.14
+++ boost.install	19 Jun 2009 10:00:47 -0000
@@ -223,4 +223,5 @@ function boost_update_6101() {
   // Copy variable
   variable_set('boost_enabled', variable_get('boost', variable_get('boost_enabled', CACHE_DISABLED)));
   variable_del('boost');
+  return array('success' => TRUE);
 }
\ No newline at end of file
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.60
diff -u -p -r1.3.2.2.2.5.2.60 boost.module
--- boost.module	18 Jun 2009 10:05:13 -0000	1.3.2.2.2.5.2.60
+++ boost.module	19 Jun 2009 10:00:48 -0000
@@ -34,6 +34,9 @@ define('BOOST_CACHE_XML',            var
 define('BOOST_CACHE_LIFETIME',       variable_get('boost_cache_lifetime', 3600));
 define('BOOST_TIME',                 time());
 define('BOOST_CACHE_QUERY',          variable_get('boost_cache_query', TRUE));
+define('BOOST_IGNORE_FLUSH',         variable_get('boost_ignore_flush', 0));
+define('BOOST_CACHE_CSS',            variable_get('boost_cache_css', FALSE));
+define('BOOST_CACHE_JS',             variable_get('boost_cache_js', FALSE));
 
 // This cookie is set for all authenticated users, so that they can be
 // excluded from caching (or in the future get a user-specific cached page):
@@ -109,6 +112,16 @@ function boost_init() {
 }
 
 /**
+ * Implementation of hook_preprocess_page().
+ *
+ * Grab references to css/js files.
+ */
+function boost_preprocess_page(&$variables) {
+  $GLOBALS['_boost_styles'] = $variables['styles'];
+  $GLOBALS['_boost_scripts'] = $variables['scripts'];
+}
+
+/**
  * Implementation of hook_exit(). Performs cleanup tasks.
  *
  * For POST requests by anonymous visitors, this adds a dummy query string
@@ -203,7 +216,7 @@ function boost_cron() {
  * Implementation of hook_flush_caches(). Deletes all static files.
  */
 function boost_flush_caches() {
-  if (variable_get('cron_semaphore', FALSE)==FALSE && (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE)) {
+  if (variable_get('cron_semaphore', FALSE)==FALSE && (variable_get('preprocess_css', FALSE)==TRUE || variable_get('preprocess_js', FALSE)==TRUE) && BOOST_IGNORE_FLUSH == 0) {
     boost_cache_clear_all();
   }
   return;
@@ -336,7 +349,6 @@ function boost_block($op = 'list', $delt
             $drupal_msg = max(count(drupal_get_messages(NULL, FALSE)), $GLOBALS['_boost_message_count']);
 
             if (BOOST_HALT_ON_ERRORS && ($error || $drupal_msg != 0)) {
-              $ttl = boost_db_get_ttl(boost_file_path($GLOBALS['_boost_path']));
               $output = t('There are <strong>php errors</strong> or <strong>drupal messages</strong> on this page, preventing boost from caching.');
               if ($error) {
                 $output .= t(' ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => print_r($error, TRUE), '!link' => l(t('Lookup Error Type'), 'http://php.net/errorfunc.constants'), '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')));
@@ -429,6 +441,7 @@ function _boost_ob_handler($buffer) {
     switch (_boost_get_content_type()) {
       case 'text/html':
         boost_cache_set($GLOBALS['_boost_path'], $buffer);
+        boost_cache_css_js_files();
         break;
       case 'application/rss';
       case 'text/xml';
@@ -630,13 +643,15 @@ function boost_cache_expire($path, $wild
  * Deletes cached page from file system
  */
 function boost_cache_kill($filename) {
-  db_query("UPDATE {boost_cache} SET expire = 0 WHERE filename = '%s'", $filename);
-  if (file_exists($filename)) {
-    @unlink($filename);
-  }
-  $gz_filename = str_replace(BOOST_FILE_PATH, BOOST_GZIP_FILE_PATH, $filename) . '.gz';
-  if (file_exists($gz_filename)) {
-    @unlink($gz_filename);
+  if (BOOST_IGNORE_FLUSH !=2) {
+    db_query("UPDATE {boost_cache} SET expire = 0 WHERE filename = '%s'", $filename);
+    if (file_exists($filename)) {
+      @unlink($filename);
+    }
+    $gz_filename = str_replace(BOOST_FILE_PATH, BOOST_GZIP_FILE_PATH, $filename) . '.gz';
+    if (file_exists($gz_filename)) {
+      @unlink($gz_filename);
+    }
   }
 }
 
@@ -715,13 +730,13 @@ function boost_db_prep($filename) {
   $boost_db = boost_get_db($filename);
   //get data from actual entry first, if this page has been cached before.
   if ($boost_db) {
-    $expire = $boost_db['lifetime'] + BOOST_TIME;
+    $expire = $boost_db['lifetime'] != -1 ? $boost_db['lifetime'] + BOOST_TIME : $expire;
     $lifetime = $boost_db['lifetime'];
     $push = $boost_db['push'];
   }
   //get data from settings table, if this page has not been put into the cache.
   elseif ($boost_settings_db) {
-    $expire = $boost_settings_db['lifetime'] + BOOST_TIME;
+    $expire = $boost_settings_db['lifetime'] != -1 ? $boost_settings_db['lifetime'] + BOOST_TIME : $expire;
     $lifetime = $boost_settings_db['lifetime'];
     $push = $boost_settings_db['push'];
   }
@@ -850,7 +865,7 @@ function boost_file_get_age($filename) {
 }
 function boost_db_get_age($filename) {
   $boost_db = boost_get_db($filename);
-  return $boost_db['expire'] != 0 ? BOOST_TIME -  $boost_db['expire'] : FALSE;
+  return $boost_db['expire'] != 0 ? $boost_db['expire'] : FALSE;
 }
 
 /**
@@ -862,7 +877,7 @@ function boost_file_get_ttl($filename) {
 }
 function boost_db_get_ttl($filename) {
   $boost_db = boost_get_db($filename);
-  return $boost_db['lifetime'] != -1 ? $boost_db['lifetime'] : BOOST_CACHE_LIFETIME - boost_db_get_age($filename);
+  return boost_db_get_age($filename) - BOOST_TIME;
 }
 
 /**
@@ -874,7 +889,7 @@ function boost_file_is_expired($filename
   return boost_file_get_age($filename) > BOOST_CACHE_LIFETIME;
 }
 function boost_db_is_expired($filename) {
-  return boost_db_get_age($filename) > BOOST_CACHE_LIFETIME;
+  return boost_db_get_age($filename) < BOOST_TIME;
 }
 
 /**
@@ -922,8 +937,108 @@ function boost_path_redirect_load($where
   }
 }
 
+function boost_cache_css_js_files() {
+  if (BOOST_CACHE_CSS) {
+    _boost_copy_css_files($GLOBALS['_boost_styles']);
+  }
+  if (BOOST_CACHE_JS) {
+    _boost_copy_js_files($GLOBALS['_boost_scripts']);
+  }
+}
+
 //////////////////////////////////////////////////////////////////////////////
 // Boost API internals
+function _boost_copy_css_files($css) {
+  //extract css file name
+  $start = 'href="' . base_path();
+  $css_files=explode($start, $css);
+  array_shift($css_files);
+  for ($i = 0; $i < count($css_files); $i++) {
+    $css_files[$i]=array_shift(explode('.css', $css_files[$i]));
+  }
+
+  //copy files
+  foreach ($css_files as $css_file) {
+    if (file_exists($css_file . '.css')) {
+      $src = $css_file . '.css';
+      $dest = BOOST_FILE_PATH . '/' . $css_file . '.css_.css';
+      _boost_mkdir_p(dirname($dest));
+      copy($src, $dest);
+      @chmod($dest, 0664);
+    }
+    if (file_exists($css_file . '.css.gz')) {
+      $src = $css_file . '.css.gz';
+      $dest = BOOST_GZIP_FILE_PATH . '/' . $css_file . '.css_.css.gz';
+      _boost_mkdir_p(dirname($dest));
+      copy($src, $dest);
+      @chmod($dest, 0664);
+    }
+    elseif (BOOST_GZIP && file_exists($css_file . '.css')) {
+      $src = $css_file . '.css';
+      $dest = BOOST_GZIP_FILE_PATH . '/' . $css_file . '.css_.css.gz';
+      _boost_mkdir_p(dirname($dest));
+      file_put_contents($dest, gzencode(file_get_contents($src), 9));
+      @chmod($dest, 0664);
+    }
+  }
+}
+
+function _boost_copy_js_files($js) {
+  //extract js file name
+  $start = 'src="'. base_path();
+  $js_files=explode($start, $js);
+  array_shift($js_files);
+  for ($i = 0; $i < count($js_files); $i++) {
+    $js_files[$i]=array_shift(explode('.', $js_files[$i]));
+  }
+
+  //copy files
+  foreach ($js_files as $js_file) {
+    if (file_exists($js_file . '.js')) {
+      $src = $js_file . '.js';
+      $dest = BOOST_FILE_PATH . '/' . $js_file . '.js_.js';
+      _boost_mkdir_p(dirname($dest));
+      copy($src, $dest);
+      @chmod($dest, 0664);
+    }
+    if (file_exists($js_file . '.js.gz')) {
+      $files[$js_file . '.js.gz'] = $js_file . '.js_js.gz';
+      $src = $js_file . '.js.gz';
+      $dest = BOOST_GZIP_FILE_PATH . '/' . $js_file . '.js_.js.gz';
+      _boost_mkdir_p(dirname($dest));
+      copy($src, $dest);
+      @chmod($dest, 0664);
+    }
+    elseif (BOOST_GZIP && file_exists($js_file . '.js')) {
+      $src = $js_file . '.js';
+      $dest = BOOST_GZIP_FILE_PATH . '/' . $js_file . '.js_.js.gz';
+      _boost_mkdir_p(dirname($dest));
+      file_put_contents($dest, gzencode(file_get_contents($src), 9));
+      @chmod($dest, 0664);
+    }
+    if (file_exists($js_file . '.jsmin.js')) {
+      $src = $js_file . '.jsmin.js';
+      $dest = BOOST_FILE_PATH . '/' . $js_file . '.jsmin.js_.js';
+      _boost_mkdir_p(dirname($dest));
+      copy($src, $dest);
+      @chmod($dest, 0664);
+    }
+    if (file_exists($js_file . '.jsmin.js.gz')) {
+      $src = $js_file . '.jsmin.js.gz';
+      $dest = BOOST_GZIP_FILE_PATH . '/' . $js_file . '.jsmin.js_.js.gz';
+      _boost_mkdir_p(dirname($dest));
+      copy($src, $dest);
+      @chmod($dest, 0664);
+    }
+    elseif (BOOST_GZIP && file_exists($js_file . '.jsmin.js')) {
+      $src = $js_file . '.jsmin.js';
+      $dest = BOOST_GZIP_FILE_PATH . '/' . $js_file . '.jsmin.js_.js.gz';
+      _boost_mkdir_p(dirname($dest));
+      file_put_contents($dest, gzencode(file_get_contents($src), 9));
+      @chmod($dest, 0664);
+    }
+  }
+}
 
 /**
  * Get's page_callback & page_arguments from menu_router table
@@ -1034,4 +1149,4 @@ if (!function_exists('file_put_contents'
     }
     return FALSE;
   }
-}
+}
\ No newline at end of file
Index: htaccess/boosted1.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/htaccess/Attic/boosted1.txt,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 boosted1.txt
--- htaccess/boosted1.txt	6 Jun 2009 07:50:23 -0000	1.1.2.6
+++ htaccess/boosted1.txt	19 Jun 2009 10:00:48 -0000
@@ -1,5 +1,5 @@
-  # BOOST START
-  <FilesMatch "\.(html.gz|html)$">
+  ### BOOST START ###
+  <FilesMatch "(\.html\.gz|\.html)$">
     <IfModule mod_headers.c>
       Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
       Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
@@ -7,31 +7,50 @@
   </FilesMatch>
   <IfModule mod_mime.c>
     AddCharset utf-8 .html
+    AddCharset utf-8 .xml
   </IfModule>
-  <FilesMatch "\.(html.gz)$">
-    AddEncoding x-gzip .gz
+  AddEncoding x-gzip .gz
+  <FilesMatch "\.html\.gz$">
     ForceType text/html
   </FilesMatch>
-  #serve file IF it exist on server
-  RewriteCond %{REQUEST_FILENAME} \.\w{2,4}$
-  RewriteCond %{REQUEST_FILENAME} -f
-  RewriteRule .* - [L]
+  <FilesMatch "\.xml\.gz$">
+    ForceType text/xml
+  </FilesMatch>
+  <FilesMatch "\.css\.gz$">
+    ForceType text/css
+  </FilesMatch>
+  <FilesMatch "\.js\.gz$">
+    ForceType text/javascript
+  </FilesMatch>
 
-  #skip boost IF not get request OR uri has wrong dir OR cookie is set OR cache dir doesn't exist
+  # Skip boost IF not get request OR uri has wrong dir OR cookie is set
   RewriteCond %{REQUEST_METHOD} !^GET$ [OR]
-  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|themes))|(/(feed|comment/reply|user|user/(login|password|register))$) [OR]
-  RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
-  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME} !-d
-  RewriteRule .* - [S=2]
+  RewriteCond %{REQUEST_URI} (^(admin|cache|misc|modules|sites|system|themes))|(/(comment/reply|user|user/(login|password|register))$) [OR]
+  RewriteCond %{HTTP_COOKIE} DRUPAL_UID
+  RewriteRule .* - [S=9]
+
+  # GZIP
+  RewriteCond %{HTTP:Accept-encoding} !gzip
+  RewriteRule .* - [S=4]
 
-  #GZIP
-  RewriteCond %{HTTP:Accept-encoding} gzip
-  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html.gz -f
-  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html.gz [L]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
+  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.xml\.gz -s
+  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.xml\.gz [L,T=text/xml]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz -s
+  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz -s
+  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript]
 
-  #NORMAL
-  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html -f
-  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html [L]
-  # BOOST END
+  # NORMAL
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
+  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.xml -s
+  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.xml [L,T=text/xml]
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_\.css -s
+  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_\.js -s
+  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
+  ### BOOST END ###
 
 # $Id: boosted1.txt,v 1.1.2.6 2009/06/06 07:50:23 mikeytown2 Exp $
Index: htaccess/boosted2.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/htaccess/Attic/boosted2.txt,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 boosted2.txt
--- htaccess/boosted2.txt	6 Jun 2009 07:50:23 -0000	1.1.2.7
+++ htaccess/boosted2.txt	19 Jun 2009 10:00:48 -0000
@@ -1,5 +1,5 @@
-  # BOOST START
-  <FilesMatch "\.(html.gz|html)$">
+  ### BOOST START ###
+  <FilesMatch "(\.html\.gz|\.html)$">
     <IfModule mod_headers.c>
       Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
       Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
@@ -7,31 +7,50 @@
   </FilesMatch>
   <IfModule mod_mime.c>
     AddCharset utf-8 .html
+    AddCharset utf-8 .xml
   </IfModule>
-  <FilesMatch "\.(html.gz)$">
-    AddEncoding x-gzip .gz
+  AddEncoding x-gzip .gz
+  <FilesMatch "\.html\.gz$">
     ForceType text/html
   </FilesMatch>
-  #serve file IF it exist on server
-  RewriteCond %{REQUEST_FILENAME} \.\w{2,4}$
-  RewriteCond %{REQUEST_FILENAME} -f
-  RewriteRule .* - [L]
+  <FilesMatch "\.xml\.gz$">
+    ForceType text/xml
+  </FilesMatch>
+  <FilesMatch "\.css\.gz$">
+    ForceType text/css
+  </FilesMatch>
+  <FilesMatch "\.js\.gz$">
+    ForceType text/javascript
+  </FilesMatch>
 
-  #skip boost IF not get request OR uri has wrong dir OR cookie is set OR cache dir doesn't exist
+  # Skip boost IF not get request OR uri has wrong dir OR cookie is set
   RewriteCond %{REQUEST_METHOD} !^GET$ [OR]
-  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|themes))|(/(feed|comment/reply|user|user/(login|password|register))$) [OR]
-  RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
-  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST} !-d
-  RewriteRule .* - [S=2]
+  RewriteCond %{REQUEST_URI} (^(admin|cache|misc|modules|sites|system|themes))|(/(comment/reply|user|user/(login|password|register))$) [OR]
+  RewriteCond %{HTTP_COOKIE} DRUPAL_UID
+  RewriteRule .* - [S=9]
+
+  # GZIP
+  RewriteCond %{HTTP:Accept-encoding} !gzip
+  RewriteRule .* - [S=4]
 
-  #GZIP
-  RewriteCond %{HTTP:Accept-encoding} gzip
-  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}.html.gz -f
-  RewriteRule .* cache/gz/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}.html.gz [L]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
+  RewriteRule .* cache/gz/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.xml\.gz -s
+  RewriteRule .* cache/gz/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.xml\.gz [L,T=text/xml]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{HTTP_HOST}%{REQUEST_URI}_\.css\.gz -s
+  RewriteRule .* cache/gz/%{HTTP_HOST}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css]
+  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{HTTP_HOST}%{REQUEST_URI}_\.js\.gz -s
+  RewriteRule .* cache/gz/%{HTTP_HOST}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript]
 
-  #NORMAL
-  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}.html -f
-  RewriteRule .* cache/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}.html [L]
-  # BOOST END
+  # NORMAL
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
+  RewriteRule .* cache/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.xml -s
+  RewriteRule .* cache/%{HTTP_HOST}%{REQUEST_URI}_%{QUERY_STRING}\.xml [L,T=text/xml]
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI}_\.css -s
+  RewriteRule .* cache/%{HTTP_HOST}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
+  RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_URI}_\.js -s
+  RewriteRule .* cache/%{HTTP_HOST}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
+  ### BOOST END ###
 
 # $Id: boosted2.txt,v 1.1.2.7 2009/06/06 07:50:23 mikeytown2 Exp $
