How do I empty the Drupal caches:
- without the Devel module
- without running some PHP Statement in a new node etc.
- without going into the database itself
Effectively, how do you instruct an end user to clear his caches?
How do I empty the Drupal caches:
Effectively, how do you instruct an end user to clear his caches?
I found the following at: http://www.drupalgardens.com/content/clear-all-caches-not-working
This helped me, because I have had issues where clearing the cache under Configuration > Performance didn't seem to help.
If you want to clear the cache from a module, you can use the following code.
You can also use the Drush module, which allows you to use the command line to execute popular Drupal commands, like "drush cron" or "drush cache clear".
The above code is for Drupal 6.
For Drupal 7 the flush-cache module would be as follows:
Note: that you then flush it by going to:
sitename.com/flush-cache
Make sure you give them permission on the permission page. Clear cache once the "normal" way if the permission doesn't appear after turning the module on.
This is preferable when you don't want your client to get access to the admin menu but you still want them to be able to flush the cache.
On-demand clearing can be done in Administer > Site Configuration > Performance.
You should setup the cron job to run every hour (or whatever interval to your liking).
When cron is run on Drupal, all caches are cleared and rebuilt without the need for a human to manually do it.
If this question pertains to theming, you should disable the caching mechanisms (css/js aggregation) and you won't have to clear the cache data when you make changes.
The following module creates a menu item that is accessible only to users with the permission "flush cache", which this module makes available on the regular user permissions page.