The boost cache should be cleared after a verify (migration, clone), otherwise some data may not be cached in the new site (because we do not copy the boost cache when we switch the platform).

A typical error would be that a cached page, ex index.html, may includes links to CSS that is also in the boost cache, but that file was not regenerated yet.

Comments

j0nathan’s picture

Subscribing.

bgm’s picture

Status: Active » Fixed

The following seems to do the trick:

diff --git a/verify.provision.inc b/verify.provision.inc
index 1bcec0d..7f6a8d9 100644
--- a/verify.provision.inc
+++ b/verify.provision.inc
@@ -72,6 +72,13 @@ function drush_provision_boost_post_provision_verify($url = NULL) {
     $config->data['boost'] = 1;
     $config->write();
     */
+
+    $config = new provisionConfig_drushrc_site(d()->name);
+
+    if ($config->data['packages']['modules']['boost']['status'] == 1) {
+      boost_cache_clear_all();
+      drush_log(dt('boost: Flushed ALL files from static page cache.'));
+    }
   } elseif (d()->type == 'platform') {
     drush_set_option('boost', drush_get_option('boost'), 'drupal');
   }

I have committed in git.koumbit.net, will push to CVS in the next release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bgm’s picture

Status: Closed (fixed) » Needs work

Note that the site must have "Ignore cache flushing : disabled" in its boost settings.

This is not ideal, evaluating whether to just force flushing the cache by calling directly:

  boost_cache_clear_all_db();
  boost_cache_delete(TRUE);

which is what boost_cache_clear_all() does.

bgm’s picture

Version: 6.x-0.4 » 6.x-1.0
Status: Needs work » Needs review

Testing this on production sites, committed to 6.x-1.x:

      // copied from boost.admin.inc function boost_reset_database_file_submit()
      // see also: http://drupal.org/node/944684
      $GLOBALS['conf']['boost_ignore_flush'] = 0;
      if (boost_cache_clear_all()) {
        db_query("TRUNCATE {boost_cache}");
        db_query("TRUNCATE {boost_cache_settings}");
        db_query("TRUNCATE {boost_cache_relationships}");
        db_query("TRUNCATE {boost_crawler}");
        _boost_rmdir_rf(BOOST_PERM_FILE_PATH, TRUE, TRUE, TRUE);
        drush_log(dt('boost: Flushed ALL files from static page cache.'));
      } else {
        drush_log(dt('boost: could NOT flush the cache, boost_cache_clear_all() mysteriously returned FALSE.'));
      }
bgm’s picture

Status: Needs review » Fixed

Marking as fixed.

* had been already committed
* sites should anyway use "ignore flush = FALSE"
* for D7 we won't do the hardcore flush, and will respect the site settings (otherwise too much weird code to maintain)

bgm’s picture

In fact, in D7, this does not seem to be an issue at all, since boost says "ignore cache flush if called from the cron". So calls to hook_flush_cache() from drush are OK.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.