CTFC - A Drupal meme (Clear The F***ing Cache)

Similar to RTFM (Read The F****ing Manual), CTFC is a headslapper that solves at a good number of the "I did everything right, but it's still not working" issues that come up with Drupal. Drupal caches theme functions, menu items, sometimes forms and entire pages. If you look at the database for any tables prefixed with cache_, you'll get an idea of just how insiduous the caching component of Drupal is.

So if you're having issues, take two CTFC's and call me in the morning.

To clear your caches, you have a few options:

1) You can go to your /admin/settings/performance page and click the Clear cached data button way down there on the bottom.

2) You can install Administration menu and hover over the icon in the top left corner (mine looks like the Acquia logo) and click the Flush all caches link (or a particular submenu item thereof).

3) I'm pretty sure you can clear the cache by manually truncating all of your database tables that start with cache_ plus the cache table. I use a program called Sequel Pro (which kicks serious butt, btw), and when I filter my tables to match cache_, here's what I get:

Note that there's a couple matching tables that shouldn't get truncated (hint: they start with imagecache...).

4) If you're really fancy, you can clear the cache using drush cc.

cache_ TABLES cache_block cachecontent LXi cache_filter cache_form cachc_menu LLj cache_mollom cache_naviga!e cache_page LXJcache.rules cache_shorten eache.views im;igecaclie_iiclion imagecache_preset block content filter form cache menu cache rnollorn navigate page cache rules shorten cache update views imagecache action imagecache preset U2 I~n I~n I~n I~n ffl ffl ni Site building Site configuration IJ Flush ail caches Variable editor Run cron Run updates Run updates Disable developer modules Drupal.org 1*1 Administration menu RUNNING ConlPnt management building Administer Empty cache Cache tables Menu Page requisites Theme registry manage meni Ing ELOPERS Clear cached data Caching data improves performance, but may cause problems while troubleshooting new modules, themes, or translations, if outdated information has been cached. To refresh all cached data on your site, click the button below. Warning: high-traffic sites experience performance slowdowns while cached data is rebuilt Clear cached data fsave configuration Reset to defaults all ( Reset to defaults y BAS CIN ds ul-


Comments

In Drupal 5 you could effectively clear cache by truncating the cache_* tables.

In Drupal 6 however this is not the case and you need to use the "Clear cached data" button. Alternatively you can install the devel module which provides a block that also contains this link, or you can use drush's cache-clear command.

Sweet, thanks for the tips Wim!

It's even more irritating when the cache isn't being held by Drupal and instead by a reverse proxy. Another rule of thumb I find helpful is to "be logged in" at least so you know you're not falling victim to external caches like Varnish, Squid, etc. - And of course, for all the rest, CTFC. Nice post, Chris.

another way: drush cc
see http://drush.ws/

Sorry about this comment but I just had to do a fly-by-night nitpick :)

"So if you're having issues, take to CTFC's and call me in the morning." -> .. take two CTFC's ..

And at point 3 "I'm pretty sure you can clear the cache manually truncating all of your database tables" -> .. the cache by manually ... or the cache manually by truncating ..

I'll be off now ...

Thank you, Random Grammer Nazi! These egregious errors have been resolved. :)

Cheers!
Chris

Also important to note that you should never clear "cache_form" since that's not a true cache but a state machine and you could seriously screw up people who are in mid process.