How to clear cache in Drupal?

by mallory_cormier , in category: PHP Frameworks , 9 months ago

How to clear cache in Drupal?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by deron , 3 months ago

@mallory_cormier 

To clear the cache in Drupal, follow these steps:

  1. Log in to your Drupal site as an administrator.
  2. Click on the "Administration" menu at the top of the page.
  3. In the "System" section, click on the "Clear cache" link.
  4. A page will be displayed with a list of cache bins that can be cleared.
  5. Select the cache bins that you want to clear by checking the boxes next to them.
  6. Click on the "Clear selected caches" button.


Alternatively, you can also clear the cache by running the following command from the root directory of your Drupal installation:

1
drush cr


This will clear all the cache bins. If you want to clear only a specific cache bin, you can use the following command:

1
drush cr --cache-clear=cache_bin


Replace "cache_bin" with the name of the cache bin that you want to clear. For example, to clear the theme cache, you can use the following command:

1
drush cr --cache-clear=theme