How to disable cache in Drupal?

by tressie.damore , in category: PHP Frameworks , 2 years ago

How to disable cache in Drupal?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by wilmer.lemke , a year ago

@tressie.damore 

To disable cache in Drupal, follow these steps:

  1. Log in to your Drupal site as an administrator.
  2. Go to the "Configuration" menu and click on "Performance."
  3. In the "Caching" section, select "None" for both "Page cache" and "Block cache."
  4. Click the "Save configuration" button.


This will disable cache for both pages and blocks on your Drupal site. Note that disabling cache can significantly impact the performance of your site, especially if you have a lot of traffic. You should only disable cache if you need to make changes to your site that are not being reflected when cache is enabled.


Alternatively, you can also disable cache by adding the following line of code to your site's settings.php file:

1
$conf['cache'] = 0;


This will globally disable caching for your site.

Member

by kadin , 9 months ago

@tressie.damore 

To disable caching in Drupal, you can follow these steps:

  1. Log in to your Drupal website as an administrator.
  2. Go to the administrative toolbar at the top of the page and click on "Configuration".
  3. In the Configuration menu, click on "Development" to open the development settings.
  4. Under the "Performance" section, click on "Performance" to access the caching options.
  5. Scroll down to the "Caching" section.
  6. Uncheck the box next to "Cache pages for anonymous users".
  7. Uncheck the box next to "Aggregate and compress CSS files".
  8. Uncheck the box next to "Aggregate JavaScript files".
  9. Click on the "Clear all caches" button at the bottom of the page to clear any existing caches.


By following these steps, you will disable caching for anonymous users and prevent Drupal from aggregating and compressing CSS and JavaScript files. This can be useful for development or debugging purposes when you want to see the changes you make immediately without waiting for the cache to update. However, disabling caching on a live website may affect its performance, so it's recommended to enable caching once you have completed your development work or debugging.