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.
-
2In 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 ArmstrongCommented Apr 2, 2013 at 13:34
-
Thanks @AlfredArmstrong: for the permission changing does clear cache affect instead of using rebuild permissions– Tue VoCommented Apr 2, 2013 at 13:37
-
1When 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 ArmstrongCommented Apr 2, 2013 at 14:09
Add a comment
|
2 Answers
REQUIRED
- When you implement hooks (not all): like
hook_menu
,hook_init
,hook_block_info
,hook_block_view
,hook_theme
and so on. - If you have checked JS/CSS aggregation and you change your these files.
- When you implement template functions in your
template.php
file (not modifications of existing functions). - When you override template files of core and contrib modules.
- Changes of
hook_menu
and.info
files. ...
NOT REQUIRED
- Modifications of existing template functions.
- Creating users, contents, content types, webforms, etc.
- Changes of existing template files, permissions, etc.
- Changes of js/css when aggregation is off.
And so on.
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