? boost-567650.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.79
diff -u -p -r1.1.2.1.2.3.2.79 boost.admin.inc
--- boost.admin.inc	30 Sep 2009 09:17:31 -0000	1.1.2.1.2.3.2.79
+++ boost.admin.inc	4 Oct 2009 07:05:20 -0000
@@ -394,6 +394,12 @@ function boost_admin_boost_performance_p
     '#default_value' => BOOST_FLUSH_DIR,
     '#description'   => t('Disable this if you have to set settings for each dir/subdir, due to the way your server operates (permissions, etc...).'),
   );
+  $form['advanced']['boost_flush_cck_references'] = array(
+    '#type'          => 'checkbox',
+    '#title'         => t('Clear all cached pages referenced via CCK with a node on insert/update/delete'),
+    '#default_value' => BOOST_FLUSH_CCK_REFERENCES,
+    '#description'   => t('The <a href="!url">Node Referrer</a> module is recommended.', array('!url', 'http://drupal.org/project/nodereferrer')),
+  );
   $form['advanced']['boost_flush_node_terms'] = array(
     '#type'          => 'checkbox',
     '#title'         => t('Clear all cached terms pages associated with a node on insert/update/delete'),
Index: boost.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.info,v
retrieving revision 1.1.2.1.2.3.2.1
diff -u -p -r1.1.2.1.2.3.2.1 boost.info
--- boost.info	24 Oct 2008 23:10:23 -0000	1.1.2.1.2.3.2.1
+++ boost.info	4 Oct 2009 07:05:20 -0000
@@ -1,5 +1,6 @@
 ; $Id: boost.info,v 1.1.2.1.2.3.2.1 2008/10/24 23:10:23 arto Exp $
 name = Boost
-description = Provides a performance and scalability boost through caching Drupal pages as static HTML files.
+description = Caches text (html, ajax, xml) outputted by Drupal as static files for performance and scalability purposes.
+recommends[] = nodereferrer
 package = Caching
 core = 6.x
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.162
diff -u -p -r1.3.2.2.2.5.2.162 boost.module
--- boost.module	30 Sep 2009 19:57:36 -0000	1.3.2.2.2.5.2.162
+++ boost.module	4 Oct 2009 07:05:21 -0000
@@ -66,6 +66,7 @@ define('BOOST_OVERWRITE_FILE',       var
 define('BOOST_DISABLE_CLEAN_URL',    variable_get('boost_disable_clean_url', FALSE));
 define('BOOST_VERBOSE',              variable_get('boost_verbose', 5));
 define('BOOST_FLUSH_NODE_TERMS',     variable_get('boost_flush_node_terms', TRUE));
+define('BOOST_FLUSH_CCK_REFERENCES', variable_get('BOOST_FLUSH_CCK_REFERENCES', TRUE));
 define('BOOST_MAX_TIMESTAMP',        variable_get('boost_max_timestamp', BOOST_TIME));
 define('BOOST_CHECK_BEFORE_CRON_EXPIRE', variable_get('boost_check_before_cron_expire', FALSE));
 define('BOOST_CRAWL_ON_CRON',        variable_get('boost_crawl_on_cron', FALSE));
@@ -435,15 +436,17 @@ function boost_votingapi_delete($votes) 
  *  node object
  */
 function boost_expire_node($node) {
+  if (empty($node->nid)) {
+    return FALSE;
+  }
+
   // Expire all relevant node pages from the static page cache to prevent serving stale content:
-  if (!empty($node->nid)) {
-    if ($node->promote == 1) {
-      boost_cache_expire_derivative('<front>');
-    }
-    boost_cache_expire_derivative('node/' . $node->nid, TRUE);
+  if ($node->promote == 1) {
+    boost_cache_expire_derivative('<front>');
   }
+  boost_cache_expire_derivative('node/' . $node->nid, TRUE);
 
-  // get terms and flush their page
+  // Get terms and flush their page
   if (module_exists('taxonomy') && BOOST_FLUSH_NODE_TERMS) {
     $tids = boost_taxonomy_node_get_tids($node->nid);
     $filenames = array();
@@ -454,6 +457,33 @@ function boost_expire_node($node) {
       boost_cache_kill($filename);
     }
   }
+
+  if (BOOST_FLUSH_CCK_REFERENCES) {
+    // Get CCK References and flush.
+    $nids = array();
+    $type = content_types($node->type);
+    foreach ($type['fields'] as $field) {
+      // Add referenced nodes to nids. This will clean up nodereferrer fields
+      // when the referencing node is updated.
+      if ($field['type'] == 'nodereference') {
+        $node_field = isset($node->$field['field_name']) ? $node->$field['field_name'] : array();
+        foreach ($node_field as $delta => $item) {
+          $nids[$item['nid']] = $item['nid'];
+        }
+      }
+    }
+    foreach ($nids as $nid) {
+      boost_cache_expire_derivative('node/' . $nid, TRUE);
+    }
+
+    // Get CCK references pointing to this node and flush.
+    if (module_exists('nodereferrer')) {
+      $nids = nodereferrer_referrers($node->nid);
+      foreach ($nids as $nid) {
+        boost_cache_expire_derivative('node/' . $nid['nid'], TRUE);
+      }
+    }
+  }
 }
 
 /**
