Install

Works with Drupal: 7.x

Using Composer to manage Drupal site dependencies

Downloads

Download clear_cache-7.x-2.0.tar.gztar.gz 8.91 KB
MD5: ed0b6ecbd3ccb6a815e539fab9678681
SHA-1: 25fc0da43f63caefce0bd13b4905fa374b9f7fb9
SHA-256: f9d39041bcd15e21e496d36afa24b36097a77111c4c63f903bd3fab1b643c44d
Download clear_cache-7.x-2.0.zipzip 9.83 KB
MD5: 513402cd9a195e26b858d671052cbf74
SHA-1: 4fccf45166cf48c6619508dd4759cc4855f740b2
SHA-256: cde562e5e00c69d01a34d80f7d6e50abf54b475ba5ad096321d490a2a8e342d3

Release notes

We had an experience where we constantly needed to clear site cache for over 400 sites at the same time.
Since this is a healthy list of cache to clear, we ran into issues where Drupal would complain about deadlocks on tables.
We traced this to the delete function on cache, which basically used delete per row. This was sucking up most of our resources.
And we love our resources, so I decided to massage the drupal_flush_all_caches function to ALWAYS use truncate instead of using delete.

And to make sure we ALWAYS use Truncate to clear tables, we changed a few lines of code in the function "drupal_flush_all_caches()" from the file located in "includes/common.inc".
Don't panic yet, this is what modules are for, so we can change Drupal core behavior without messing things for everyone.
Truncate is much faster to use than db_delete() because truncate deletes ALL ROWS, leaving the structure and columns intact rather than deleting row by row.
In fact, the function below is similar to drupal_flush_all_caches(), with a few omissions and additions.
We Don't truncate the "cache_form" table because in-progress form submissions may break.
Note that the table "cache_page" is the last table to be truncated.

Created by: geforcegtx480
Created on: 5 May 2016 at 19:42 UTC
Last updated: 20 Aug 2016 at 00:43 UTC
New features

Other releases