? boost-1.patch
? boost-62784.patch
? boost-627844.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.241
diff -u -p -r1.3.2.2.2.5.2.241 boost.module
--- boost.module	9 Nov 2009 10:47:13 -0000	1.3.2.2.2.5.2.241
+++ boost.module	9 Nov 2009 22:35:02 -0000
@@ -475,6 +475,17 @@ function boost_nodeapi(&$node, $op, $tea
       boost_expire_node($node);
       boost_cache_expire_router($data, TRUE, TRUE);
       break;
+    case 'presave':
+      // Logic taken from path_redirect_node_presave()
+      if (!empty($node->path)) {
+        $node_path = 'node/'. $node->nid;
+        $old_alias = drupal_get_path_alias($node_path, ($node->language ? $node->language : ''));
+        if ($old_alias != $node_path && $node->path != $old_alias) {
+          // If the user is manually changing the path alias, nuke the old files
+          boost_cache_expire_router($data, TRUE, TRUE);
+        }
+      }
+      break;
   }
 }
 
@@ -1313,12 +1324,40 @@ function _boost_ob_handler() {
         $filename = boost_file_path($GLOBALS['_boost_path'], TRUE, BOOST_FILE_EXTENSION);
       }
     }
+  }
+  // Remove dead items from the cache (file & db)
+  if ($filename) {
+    $files = array(array('filename' => $filename));
+    boost_cache_kill($files, TRUE);
+    boost_remove_db($files);
+  }
+
+  // Remove cached items when a redirect happens
+  if (empty($GLOBALS['_boost_router_item']['page_callback']) && boost_headers_contain('Location: ')) {
+    $types = boost_get_content_type();
+    if (BOOST_VERBOSE >= 7) {
+      watchdog('boost', 'Debug: _boost_ob_handler() <br />HTTP Info: Location redirect for !types <br />Path: !path', array('!status' => $status, '!types' => implode(', ', $types), '!path' => boost_file_path($GLOBALS['_boost_path'])));
+    }
+    $types = array_pop($types);
+
+    if (stristr($types, 'text/javascript')) {
+      $filename = boost_file_path($GLOBALS['_boost_path'], TRUE, BOOST_JSON_EXTENSION);
+    }
+    elseif (stristr($types, 'application/rss') || stristr($types, 'text/xml') || stristr($types, 'application/rss+xml')) {
+      $filename = boost_file_path($GLOBALS['_boost_path'], TRUE, BOOST_XML_EXTENSION);
+    }
+    elseif (stristr($types, 'text/html')) {
+      $filename = boost_file_path($GLOBALS['_boost_path'], TRUE, BOOST_FILE_EXTENSION);
+    }
+
+    // Remove dead items from the file cache
     if ($filename) {
       $files = array(array('filename' => $filename));
       boost_cache_kill($files, TRUE);
-      boost_remove_db($files);
     }
   }
+
+
 }
 
 /**
@@ -2565,7 +2604,7 @@ function boost_get_time($table, $column)
  *   Should the contents be gzipped?
  *   0 = No
  *   1 = Yes
- *   2 = Yes & decompress & recompress
+ *   2 = Yes & decompress & re-compress
  */
 function boost_cache_write($filename, $data, $gzip) {
   if (boost_headers_contain('gzip') && $gzip == 0) {
