How to clear cache in Drupal?

by mallory_cormier , in category: PHP Frameworks , 2 years ago

How to clear cache in Drupal?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by deron , a year 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


by elise_daugherty , 9 months ago

@mallory_cormier 

To clear the cache in Drupal, follow these steps:

  1. Log in to your Drupal site as an administrator.
  2. Go to the Admin toolbar and click on Configuration.
  3. Under the Development section, click on Performance.
  4. On the Performance page, you will see options to clear various caches: Clear all caches: This clears all cached data, including CSS and JavaScript files, theme registry, and page cache. Clear selected caches: This allows you to select specific caches to clear. You can select options such as CSS and JavaScript, theme registry, or page cache. Clear cache for a specific theme: If you are using multiple themes, you can select a theme and clear its cache. Clear CSS and JavaScript cache: This clears only the cached CSS and JavaScript files.
  5. Select the desired cache clearing option and click on the respective button to clear the cache.


After clearing the cache, Drupal will rebuild the cached data as needed, which may take a short while.