There are a lot of cache related tables in the database. Is there a list somewhere of which ones can be emptied safely, or can they all? Here is a list of the tables I am seeing and the number of rows: cache 3 cache_block 33 cache_content 403 cache_filter 56 cache_menu 2 cache_page 0 cache_views 11
All cache tables, by definition, can be cleared at any time without the site breaking down and crying. Generally you shouldn't need to do so yourself, as Drupal will clean up after itself when it needs to. You can, however, just truncate a cache table if you think there's stale data in it without breaking the site. The exception is cache_views, which in D5 does not rebuild-on-demand but only on certain events, such as adding a module or clicking the "clear views cache" button on the Tools tab of the Views admin page. Don't clear that one manually unless you really know what you're doing. :-) Other than that, the cache system is usually safe to just leave alone. --Larry Garfield On Wed, 27 Feb 2008 11:34:15 -0500, sander-martijn <lists@severeddreams.com> wrote:
There are a lot of cache related tables in the database. Is there a list somewhere of which ones can be emptied safely, or can they all? Here is a list of the tables I am seeing and the number of rows:
cache 3 cache_block 33 cache_content 403 cache_filter 56 cache_menu 2 cache_page 0 cache_views 11
-- [ Drupal support list | http://lists.drupal.org/ ]
perfect, thanks. I had to clear cache to get the secure pages module working - it was listed as a solution on one of the support pages. I have occasionally seen solutions like this posted but didn't know if there were tables I shouldn't touch. Same with migration - no need to migrate cache, but i suspected there might be an issue suche as the one you mentioned regarding cache_views. Glad I asked before wreaking havoc on a production site. Larry Garfield wrote:
All cache tables, by definition, can be cleared at any time without the site breaking down and crying. Generally you shouldn't need to do so yourself, as Drupal will clean up after itself when it needs to. You can, however, just truncate a cache table if you think there's stale data in it without breaking the site.
The exception is cache_views, which in D5 does not rebuild-on-demand but only on certain events, such as adding a module or clicking the "clear views cache" button on the Tools tab of the Views admin page. Don't clear that one manually unless you really know what you're doing. :-)
Other than that, the cache system is usually safe to just leave alone.
--Larry Garfield
On Wed, 27 Feb 2008 11:34:15 -0500, sander-martijn <lists@severeddreams.com> wrote:
There are a lot of cache related tables in the database. Is there a list somewhere of which ones can be emptied safely, or can they all? Here is a list of the tables I am seeing and the number of rows:
cache 3 cache_block 33 cache_content 403 cache_filter 56 cache_menu 2 cache_page 0 cache_views 11
-- [ Drupal support list | http://lists.drupal.org/ ]
Larry Garfield wrote:
The exception is cache_views, which in D5 does not rebuild-on-demand but only on certain events, such as adding a module or clicking the "clear views cache" button on the Tools tab of the Views admin page. Don't clear that one manually unless you really know what you're doing. :-)
I'm not positive on this, but from what I can tell, the views cache isn't a special case, and using that tool simply empties out the table like any other cache clearing operation (via cache_clear_all). -Jonathan -- Jonathan Hedstrom OpenSourcery http://opensourcery.com Technology for Good
On Friday 29 February 2008, Jonathan Hedstrom wrote:
Larry Garfield wrote:
The exception is cache_views, which in D5 does not rebuild-on-demand but only on certain events, such as adding a module or clicking the "clear views cache" button on the Tools tab of the Views admin page. Don't clear that one manually unless you really know what you're doing. :-)
I'm not positive on this, but from what I can tell, the views cache isn't a special case, and using that tool simply empties out the table like any other cache clearing operation (via cache_clear_all).
-Jonathan
I spoke with Earl Miles about it the other night, and I did misspeak. The views cache will rebuild itself if it is empty; however, if it has only some records in it then it will not auto-rebuild except in certain situations. It's all or nothing, really. So yes, just truncating all cache_* tables is safe to do. :-) -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson
participants (3)
-
Jonathan Hedstrom -
Larry Garfield -
sander-martijn