Tuesday, December 27, 2011

Clear cache programmatically in Drupal 6


This will reduce the work by going to performance settings page (admin/settings/performance) & clicking "cleared cached data" by scrolling down

But make sure that this page is only accessed by administrator


For Drupal 6 create page with the following code:

<?php
  drupal_flush_all_caches();
  drupal_set_message('cache flushed.');
?>

1 comment: