Hi,

I've noticed that Boost only unlink files from normal cache directory. I've enabled the Boost_mobile module, but on call boost_expire_cache() the mobile files are stayed.
I've extended the boost module boost_expire_cache() function to support boost_mobile. My Boost module is already support GZIP, this is available also in my code-snippet.

if ($filename && file_exists($filename)) {
        if (module_exists('boost_mobile')) {
          $normal_dir = boost_get_normal_cache_dir();
          $mobile_dir = boost_mobile_get_mobile_cache_dir();
          $mobile_filename = str_replace($normal_dir, $mobile_dir, $filename);
        }
        if (BOOST_GZIP && file_exists($filename.'.gz')) {
          unlink($filename.'.gz');
          if (isset($mobile_filename) && file_exists($mobile_filename)) {
            unlink($mobile_filename.'.gz');
          }
        }
        if (unlink($filename)) {
          $extra = '';
          if (isset($mobile_filename) && unlink($mobile_filename)) {
            $extra = ' (From mobile also)';
          }
          boost_log('Removed !file from the boost cache.' . $extra, array('!file' => $filename), WATCHDOG_DEBUG);
        }
        else {
          boost_log('Could not delete !file from the boost cache. Check file permissions.', array('!file' => $filename), WATCHDOG_WARNING);
        }
      }

I hope it helps somebody.

CommentFileSizeAuthor
#2 boost_supports_boost_mobile.patch1.99 KBdanyg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Frank.dev’s picture

Where should the code be added?

danyg’s picture

Sorry my late answer. This snippet is in boost_expire_cache() function around line #398.
I made a patch, I hope it helps.