Cache Clear

This is a basic drupal module.
Empties cached tables, rebuilds the menu cache and theme registries, and invokes a hook so that other modules' that cache data can be cleared as well.
See https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_flush_all_caches/7 for the cache flush_all_caches documentation.

Clearing cache is relatively harmless.
Your sites may slow down while clearing cache.
For this reason, make sure you give the right people access to clear_cache.
Note: Clear Cache does not clear web browser cache,
This will need to be cleared separately. :p.

clear_cache adds a menu link item on the administrative toolbar.
Note that clear_cache is based on user permissions. See the "User Permissions" section bellow.

Install Instructions:

  1. Download and unzip clear_cache.
  2. Drag "clear_cache" file to your "sites/all/modules" folder.
    If you have a "contrib" folder inside "sites/all/modules", then drag clear_cache there.
  3. Enable "clear_cache" module, find the people "permissions" tab.
    This should be in http://YOUR_SITE_URL/admin/people/permissions
  4. Enable clear_cache for various user roles.
  5. Do not enable "clear_cache" for anonymous users!
  6. "Clear Cache" menu link will now appear on your administrative toolbar.
  7. Refresh your home page.
  8. If you use drush, use the command drush batman to clear cache.

User Permissions:

You will need to configure permissions for using clear_cache.

  1. Navigate to http://YOUR_SITE_URL/admin/people/permissions
  2. Locate the Clear Cache permissions from the list. Depending on your permissions list, you may need to scroll down a bit.
  3. ONLY check the "Can clear cache" permission for TRUSTED users.
  4. Save.

Why use clear_cache?

  1. Speed => Faster than the traditional Drupal core clear cache function. We tested clear cache on a multi-site install (with 86 sites plus 2 organic groups sites). clear_cache was at least two thirds faster than drush @sites cc all.
    * Of course, your speed may vary depending on your server hardware, database and php version.
  2. Convenient => clear_cache adds a "clear cache" link to the administrative toolbar for faster access.
  3. User permissions => you can customize who can use clear_cache
  4. Drush integration => starting from version 7.x-2.5 , we integrated drush. e.g. Use drush batman to clear cache.

Using Drush:

  1. drush en clear_cache will enable the clear_cache module.
  2. drush @sites en clear_cache will enable clear cache on multisite install.
  3. drush batman-clear-cache the command to clear cache
  4. drush batman the Alias, personally, I like this one better.
  5. drush @sites batman if you have a multisite install and clear cache is enabled on all sites.
  6. If you have the "help" module enabled, navigate to http://YOUR_SITE_URL/admin/help/clear_cache for more drush documentation

Have fun ;)

Sponsored by:

Arts & Sciences @ Washington University in Saint Louis.

Project information

Releases