3

I'm a newbie in Drupal. I usually use the clear cache function from Devel module for each changes(sometime I use drush command line tool) like: modify CSS, create/change blocks, change permissions, create new content type, create new web form, change template files... and clearing the cache costs a lot of time on my local environment (I've just 1GB of RAM). So can anyone show me which actions in Drupal that we need to clear cache.

  • 2
    In general, if you used the UI to make the change, you don't need to clear cache. If you changed source files (such as CSS stylesheets, you do.) That'll cover 95% of cases. – Alfred Armstrong Apr 2 '13 at 13:34
  • Thanks @AlfredArmstrong: for the permission changing does clear cache affect instead of using rebuild permissions – VoTue Apr 2 '13 at 13:37
  • 1
    When you say "rebuild permissions" are you referring rebuilding node access permissions? You don't normally need to do that unless you have a content access module installed, and in any case changing the permissions associated with roles won't require it, as it's essentially a different layer of access control. – Alfred Armstrong Apr 2 '13 at 14:09
1

REQUIRED

  1. When you implement hooks (not all): like hook_menu, hook_init, hook_block_info, hook_block_view, hook_theme and so on.
  2. If you have checked JS/CSS aggregation and you change your these files.
  3. When you implement template functions in your template.php file (not modifications of existing functions).
  4. When you override template files of core and contrib modules.
  5. Changes of hook_menu and .info files. ...

NOT REQUIRED

  1. Modifications of existing template functions.
  2. Creating users, contents, content types, webforms, etc.
  3. Changes of existing template files, permissions, etc.
  4. Changes of js/css when aggregation is off.

And so on.

1

Strategy is quite easy - clear it when you changed something in code or database.

Below some popular cases (based on my experience):

  • you added new content and need to update cached pages, views or blocks (for example you enables cache for anonymous users)
  • you changed JS or CSS files and you have enabled aggregation
  • you installed new modules (in this case need to run update.php)
  • you did modifications in existing module which require update cache. For instance added menu item or implemented some hooks.
  • you did changes in theme files

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.