function drupal_flush_all_caches

Same name and namespace in other branches
  1. 9 core/includes/ \drupal_flush_all_caches()
  2. 8.9.x core/includes/ \drupal_flush_all_caches()
  3. 10 core/includes/ \drupal_flush_all_caches()
  4. 11.x core/includes/ \drupal_flush_all_caches()

Flushes all cached data on the site.

Empties cache tables, rebuilds the menu cache and theme registries, and invokes a hook so that other modules' cache data can be cleared as well.

14 calls to drupal_flush_all_caches()
AggregatorRenderingTestCase::testBlockLinks in modules/aggregator/aggregator.test
Adds a feed block to the page and checks its links.
BlockTestCase::testBlockRehash in modules/block/block.test
Test _block_rehash().
CacheClearCase::testFlushAllCaches in modules/simpletest/tests/cache.test
Test drupal_flush_all_caches().
DrupalWebTestCase::resetAll in modules/simpletest/drupal_web_test_case.php
Reset all data structures after having enabled new modules.
EnableDisableTestCase::testEntityInfoChanges in modules/system/system.test
Ensures entity info cache is updated after changes.

... See full list


includes/, line 7812


function drupal_flush_all_caches() {
    // Change query-strings on css/js files to enforce reload for all users.
    // Rebuild the theme data. Note that the module data is rebuilt above, as
    // part of registry_rebuild().
    // node_menu() defines menu items based on node types so it needs to come
    // after node types are rebuilt.
    // Synchronize to catch any actions that were added or removed.
    // Don't clear cache_form - in-progress form submissions may break.
    // Ordered so clearing the page cache will always be the last action.
    $core = array(
    $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
    foreach ($cache_tables as $table) {
        cache_clear_all('*', $table, TRUE);
    // Rebuild the bootstrap module list. We do this here so that developers
    // can get new hook_boot() implementations registered without having to
    // write a hook_update_N() function.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.