From d0bb04e745bd07a02e2cae943964e5447ce68096 Mon Sep 17 00:00:00 2001 From: Mikey O'Toole Date: Tue, 25 May 2021 09:32:33 +0100 Subject: [PATCH] Describe logic behind placement of `invalidateRouteCache` --- CRM/Core/Invoke.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index db70f80f00..dbd42aa066 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -394,6 +394,9 @@ class CRM_Core_Invoke { CRM_Utils_Request::retrieve('triggerRebuild', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, 0, 'GET') ) { Civi::service('sql_triggers')->rebuild(); + // Rebuild Drupal 8/9/10 route cache only if "triggerRebuild" is set to TRUE as it's + // computationally very expensive and only needs to be done when routes change on the Civi-side. + // For example - when uninstalling an extension. We already set "triggerRebuild" to true for these operations. $config->userSystem->invalidateRouteCache(); } CRM_Core_DAO_AllCoreTables::reinitializeCache(TRUE); -- 2.25.1