12.2. Clearing the Cache

Last updated on
14 April 2025

Goal

Clear or rebuild your site’s internal caches to ensure they are up-to-date with the most recent data, using the user interface or Drush.

Site prerequisites

If you want to use Drush to clear the cache, Drush must be installed. See Bagian 3.2, “Concept: Additional Tools”.

Steps

You can use the administrative interface or Drush to clear the cache.

Using the administrative interface

  1. In the Manage administrative menu, navigate to Configuration > Development > Performance (admin/config/development/performance).
  2. Click Clear all caches.
  3. A message saying the cache has been cleared appears at the top of the page.

Using Drush

You can use one of two commands:

  • Use the command drush cache-rebuild to clear and rebuild all cached data for a site. After running this command, you will see the output message "Cache rebuild complete."
  • Use the command drush cc to see a list of individual caches and then choose the specific cache you would like to clear. Running this command should produce output like the following:

    > drush cc
    Enter a number to choose which cache to clear.
     [0]  :  Cancel
     [1]  :  drush
     [2]  :  theme-registry
     [3]  :  menu
     [4]  :  css-js
     [5]  :  block
     [6]  :  module-list
     [7]  :  theme-list
     [8]  :  render
     [9]  :  views

Choose a cache to clear by entering the number associated with that cache. Press "Enter" to continue.

Additional resources

Drupal.org community documentation page "Clearing or rebuilding Drupal’s cache"

Attributions

Adapted and edited by Joe Shindelar and Jack Haas from "Clearing or rebuilding Drupal’s cache", copyright 2000-2017 by the individual contributors to the Drupal Community Documentation.

 

This page is generated from AsciiDoc source from the User Guide. To propose a change, edit the source and attach the file to a new issue in the User Guide project. PDF and e-book formats are available on the User Guide project page.

Source file: prevent-cache-clear.asciidoc

Help improve this page

Page status: No known problems

You can: