Notes on the Drupal Cache System

These are notes about the Drupal cache system and supporting tables. Much of this was jotted down while reading Pro Drupal Development by John VanDyk and Matt Westgate. It is a good book. You should buy it.

Drupal Core Default Cache Tables

cache
Stores module settings and is default table used by cache_set()
cache_filter
Stores copies of each node's content after parsing by the filter system.
cache_menu
Stores copies of navigational menus for each user. Menus are cached on a per-user, and per-locale basis.
cache_page
Stores cached copies of pages for anonymous users.

Performance cache settings (admin/settings/performance) affect the page cache only. Filters, menus, and module settings are always cached.

Filtered Input Formats

When a node is created or edited, filters are applied and the results are stored to cache_filter, regardless of performance cache settings.

filter_cache stores teasers, preventing changes to the default teaser length from taking place until a node is edited. Emptying the cache_filter table will cause all teasers to be regenerated when the page is viewed.

Administration Variables and Module Settings

Administration variables and module settings are typically stored in the variables table, and that data is stored in a single row of the cache table as a serialized array. Any variable that uses variable_set() and variable_get() will be stored this way.