2

Boost is working good on my website but the problem is that after making any changes to my website I clear all cache from performance page. The changes I have done are reflecting if I am accessing site with www but not updating if I am accessing website without www

2

You need to clear the Boost cached pages, i.e. the static pages. You can do that on the Boost settings page at the bottom under Clear Boost's Database & File Cache. If you only have changed one page you can just clear this page by enabling the boost block Boost: Pages cache configuration.

Edit: After a bit more thinking I am not sure clearing the Boost cache will fix your issue. However, do yourself a favor and change your .htaccess rules to redirect users to either with www or without www. I would suggest with as that is working for you. Having both counts as duplicated content in search engines and you risk to loose ranking.

To fix this, uncomment the following part in your .htaccess file (around line 81), or add it if it's missing:

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
1
  • thanks for help, but if I am accessing website through parked domains it still shows the cached website. – Fahad Ur Rehman Mar 15 '13 at 20:03
1

Boost actually caches the pages by url. So it treats www and without www are 2 unique urls and cache them separately. So as suggested above, you can redirect all urls without www to www urls so that users access only 1 url any time. Or else you need to clear cache for both the urls.

0

You can also implement some hooks to automatically clear the cache.

The below code is a bit aggressive, and just clears everything at any node change. It could be done more sophisticated, only clearing what is necessary.

/**
* Flush all Boost's cache when any change is made.
*/
if (function_exists('_boost_rmdir')) {
  function your_module_clear_cache($flush=true) {
    _boost_rmdir(boost_get_normal_cache_dir(), $flush);
  }
  function your_module_node_update($node) {
    your_module_clear_cache();
  }
  function your_module_node_delete($node) {
    your_module_clear_cache();
  }
  function your_module_node_insert($node) {
    your_module_clear_cache();
  }
  function your_module_entity_translation_save($node) {
    your_module_clear_cache();
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.