Hi, I've almost got a Boost compatable mobile subdomain set up and running on the charity site that I administer. The funal hurdle I'm stuck at is that the cache directory of the mobile subdomain isn't being cleaned out when the caches are flushed (by pressing the button in the Performance menu or by the Cache Expire module).

Both these methods empty out the cache/normal/www.mysite.co.uk directory completely (as they should) but they don't empty the cache/normal/m.mysite.co.uk one. The static html files are written in there but seem to remain long after they should have been flushed.

Both directories and files within them seem to have the same chown/chgroup and permissions. I can't delete them manually via FireFTP as the chown and chgrp seems to be apache and it won't let my user account rename or delete any of them. It seems the rmdir command is just telling Boost to remove the cache/normal/www.mysite.co.uk directory, when it should remove the whole cache/normal one?

I've tried with various boost directories normal/normalv2/normalv3 etc and have experimented with creating the folders manually and letting Boost create them. Nothing does the trick though.

Is there something obvious I am missing?

Thanks,

Ben

Comments

Anonymous’s picture

Both directories and files within them seem to have the same chown/chgroup and permissions. I can't delete them manually via FireFTP as the chown and chgrp seems to be apache and it won't let my user account rename or delete any of them.

That's normal, since boost created the files it would be able to delete them as PHP in your set up is running as a different user to FTP.

It seems the rmdir command is just telling Boost to remove the cache/normal/www.mysite.co.uk directory, when it should remove the whole cache/normal one?

I'd say that is very normal too, cron is going to flush the cache of the site it's on, so if the cron from www.mysite.co.uk runs it will flush cache/normal/www.mysite.co.uk same with m.mysite.co.uk. Otherwise you'd have a scenario where in a multi-domain set up like techdocs.example.com, www.example.com and forum.example.com, then the crons would be wiping out each others' caches.

Maybe you should explain the steps you'd taken to create this mobile version of the site and why it appears that you don't have a cron for each sub-domain.

badlydrawnben’s picture

Hi Philip,

Thanks for getting back to me. I hadn't thought about the cron-only-flushing-the-domain-its-on scenario but that makes sense.

The mobile site (subdomain) shares the same Drupal installation as the main one, it uses a different theme. I am using a module from here http://bitcookie.com/blog/integrating-drupal-7s-boost-and-mobile-tools that uses js to detect the browser type.

In my sites/ folder I created a www.mysite.co.uk folder and a m.mysite.co.uk one. The settings.php in the m.mysite.co.uk folder tells it to use the mobile theme. There's links in the footer of each site that allow you to switch betwen the desktop and mobile version. It sets a cookie to remember your choice. All of that works great as far as I can tell.

Whilst they share the same Drupal database, the cron jobs only seem to see and flush the www.mysite.co.uk domain. I guess I need to add in a cron job to clear the m.mysite.co.uk boost cache folders of expired files as well? Can I do that from within Drupal somehow?

Cheers,

Ben

bitcookie’s picture

If both of the cache directories have the same user/group then it's not a problem with permissions. Boost probably looks up its own domain name when boost_flush_caches() is called. Since you're calling that only via www.mysite.co.uk/ then it's only clearing that corresponding directory.

Try these, I don't know if they'll work.

Try having 2 separate cron jobs, one that points to www.mysite.co.uk/cron... and the other pointing to m.mysite.co.uk/cron... Maybe then boost will pick up the root url and figure out the proper cache directory. Maybe not if it's declared somewhere else or stored.

Or, try making a custom module that implements hook_flush_caches() the same way boost does and then manually code the path to the mobile cache directory.

nevosa’s picture

Issue summary: View changes

I've solved this by duplicading the code in boost_cache_delete($flush = FALSE)
into my custom module, and then running it via mymodule_cron() as follows:
boost_cache_delete($flush,$domainx) {
// replaced all the references boost has to BOOST_FILE_PATH
// to $domainx
}

good luck!