Feb 032012
 

Caching helps to cut the load on server & increase server speed. Hence, Drupal comes with caching build-in at various levels. there will be situations where,  you may want to disable *ALL* caching like I was doing some module development and without clearing out the caches the changes were not visible. So, I had to disable caches.  Incase, you too want to disable Caching for say for development – here below

  1. Go to Site Configuration -> Performance:
    • Set the following options, and click Save configuration:
      • Caching mode: Disabled
      • Minimum cache lifetime: none
      • Page compression: Disabled
      • Block cache: Disabled
      • Optimize CSS files: Disabled
      • Optimize JavaScript files: Disabled
    • Click Clear cached data.
  2. Go to Site building -> Views -> Tools:
    • Check Disable views data caching and click Save configuration.
    • Click Clear Views’ cache.
  3. Install the Devel module, and go to Site Configuration -> Devel settings:
    • Check Rebuild the theme registry on every page load and click Save configuration.
  4. Add the following to your .module file to disable menu caching

function hook_init(){
   //FIXME: remove before going into production
   menu_rebuild();
}

With this, now ALL caching in drupal will disabled. Enjoy quicker development & don’t forget to undo these changes once your site goes into production!

Related posts:

  1. Getting Started with Drupal Module Development
  2. Enable right-click on pages where its been disabled

  One Response to “How-To Fully Disable Caching in Drupal 7”

  1. Thanks, this is exactly what I’m looking for!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>