From c8bde6b91c1923d6448b47b3251f2aca150953db Mon Sep 17 00:00:00 2001 From: Chris Charlton Date: Fri, 20 Dec 2024 12:34:16 -0800 Subject: [PATCH] Update technical note for Object Cache with Drupal (#9051) D9 and D7 needed the steps that are no longer considered optional. --- .../addons/object-cache/howto/drupal.md | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/source/content/addons/object-cache/howto/drupal.md b/source/content/addons/object-cache/howto/drupal.md index d093279bdd..41cb84a3f7 100644 --- a/source/content/addons/object-cache/howto/drupal.md +++ b/source/content/addons/object-cache/howto/drupal.md @@ -119,6 +119,26 @@ contributors: [cityofoaksdesign, carolynshannon, jms-pantheon, whitneymeredith] + + + After enabling Redis, there are cache tables in the database that are no longer being used. Even when the Drupal cache is cleared, these tables will not be emptied. For sites that were live for awhile before Redis was enabled, there could be significant amounts of data in these tables. Removing this data could increase the speed of cloning, exporting, and backing up the database. + + 1. [Connect directly to MySQL](/guides/mariadb-mysql/mysql-access) and run the command below to view the cache: + + ```sql + SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'cache%' AND table_name != 'cache_form'; + ``` + + This returns a list of all the cache tables in the database. These are safe to empty, but don't remove the tables themselves in case Redis is disabled in the future. + + 1. Run the command below on each table, replacing `` with the name of the cache table, to empty the cache: + + ```sql + TRUNCATE TABLE ``; + ``` + + + ## Drupal 7 @@ -168,23 +188,9 @@ This configuration uses the `Redis_CacheCompressed` class for better performance 1. Visit `/admin/config/development/performance/redis` and open **Connection Information** to verify the connection. - - -After enabling Redis, there are cache tables in the database that are no longer being used. Even when the Drupal cache is cleared, these tables will not be emptied. For sites that were live for awhile before Redis was enabled, there could be significant amounts of data in these tables. Removing this data could increase the speed of cloning, exporting, and backing up the database. - -1. [Connect directly to MySQL](/guides/mariadb-mysql/mysql-access) and run the command below to view the cache: - - ```sql - SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'cache%' AND table_name != 'cache_form'; - ``` - - This returns a list of all the cache tables in the database. These are safe to empty, but don't remove the tables themselves in case Redis is disabled in the future. + -1. Run the command below on each table, replacing `` with the name of the cache table, to empty the cache: - - ```sql - TRUNCATE TABLE ``; - ``` +After enabling Redis, there are cache tables in the database that are no longer being used. Refer to the "Database Cleanup" section above for steps on how to truncate the existing cache tables to make sure the latest data populates object cache properly.