? boost-453908.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.44 diff -u -p -r1.1.2.1.2.3.2.44 boost.admin.inc --- boost.admin.inc 31 Jul 2009 09:49:23 -0000 1.1.2.1.2.3.2.44 +++ boost.admin.inc 2 Aug 2009 06:10:56 -0000 @@ -255,6 +255,12 @@ function boost_admin_boost_performace_pa '#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 opperates (permissions, etc...).'), ); + $form['advanced']['boost_flush_node_terms'] = array( + '#type' => 'checkbox', + '#title' => t('Flush all cached terms pages associted with a node on insert/update/delete'), + '#default_value' => BOOST_FLUSH_NODE_TERMS, + '#description' => t('Works with view\'s taxonomy/term/% path as well as core.'), + ); $form['advanced']['boost_overwrite_file'] = array( '#type' => 'checkbox', '#title' => t('Overwrite the cached file if it already exits'), Index: boost.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v retrieving revision 1.3.2.2.2.5.2.84 diff -u -p -r1.3.2.2.2.5.2.84 boost.module --- boost.module 31 Jul 2009 09:49:23 -0000 1.3.2.2.2.5.2.84 +++ boost.module 2 Aug 2009 06:10:57 -0000 @@ -44,6 +44,7 @@ define('BOOST_PERMISSIONS_DIR', var define('BOOST_OVERWRITE_FILE', variable_get('boost_overwrite_file', FALSE)); 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)); // 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): @@ -325,6 +326,18 @@ function boost_nodeapi(&$node, $op, $tea } boost_cache_expire_derivative('node/' . $node->nid, TRUE); } + + // get terms and flush their page + if (BOOST_FLUSH_NODE_TERMS) { + $terms = taxonomy_node_get_terms(node_load($node->nid)); + $filenames = array(); + foreach($terms as $term) { + $filenames = array_merge($filenames, boost_get_db_term($term->tid)); + } + foreach($filenames as $filename) { + boost_cache_kill($filename); + } + } break; } } @@ -1316,6 +1329,18 @@ function boost_get_settings_db($router_i } /** + * Returns all cached pages asscoited with the taxonomy term. + */ +function boost_get_db_term($term) { + $filenames = array(); + $result = db_query("SELECT filename FROM {boost_cache} WHERE expire > 0 AND page_id = %d AND page_callback = 'taxonomy'", $term); + while ($filename = db_fetch_array($result)) { + $filenames[] = $filename['filename']; + } + return $filenames; +} + +/** * Writes data to filename in an atomic operation thats compatible with older * versions of php (php < 5.2.4 file_put_contents() doesn't lock correctly). *