From cb183ee49c30e2d7c425981a38da6b570d1e8df3 Mon Sep 17 00:00:00 2001 From: Bysa Boro Date: Thu, 28 May 2026 17:35:08 +0100 Subject: [PATCH 1/2] Pre-compile Twig templates after Pantheon deploy Add `drush twig:compile` after the final `cr` in deployPantheonSync so the first request post-deploy doesn't pay the template compilation cost. Co-Authored-By: Claude Opus 4.7 (1M context) --- robo-components/DeploymentTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/robo-components/DeploymentTrait.php b/robo-components/DeploymentTrait.php index 00e7435d1..0b647d66c 100644 --- a/robo-components/DeploymentTrait.php +++ b/robo-components/DeploymentTrait.php @@ -507,6 +507,7 @@ public function deployPantheonSync(string $env = 'test', bool $do_deploy = TRUE) ->exec("terminus remote:drush $pantheon_terminus_environment -- cim --no-interaction") ->exec("terminus remote:drush $pantheon_terminus_environment -- cim --no-interaction") ->exec("terminus remote:drush $pantheon_terminus_environment -- cr") + ->exec("terminus remote:drush $pantheon_terminus_environment -- twig:compile") ->exec("terminus remote:drush $pantheon_terminus_environment -- deploy:hook --no-interaction") ->run() ->getExitCode(); From 61b9fe2f3e66781fc8fc464414680b8070e5f5c9 Mon Sep 17 00:00:00 2001 From: Bysa Boro Date: Fri, 29 May 2026 12:39:38 +0100 Subject: [PATCH 2/2] Apply suggestion from @bboro --- robo-components/DeploymentTrait.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/robo-components/DeploymentTrait.php b/robo-components/DeploymentTrait.php index 0b647d66c..130ea28fa 100644 --- a/robo-components/DeploymentTrait.php +++ b/robo-components/DeploymentTrait.php @@ -507,6 +507,8 @@ public function deployPantheonSync(string $env = 'test', bool $do_deploy = TRUE) ->exec("terminus remote:drush $pantheon_terminus_environment -- cim --no-interaction") ->exec("terminus remote:drush $pantheon_terminus_environment -- cim --no-interaction") ->exec("terminus remote:drush $pantheon_terminus_environment -- cr") + // Pre-warm the Twig template cache so the first anonymous request + // after deploy gets a cached hit. ->exec("terminus remote:drush $pantheon_terminus_environment -- twig:compile") ->exec("terminus remote:drush $pantheon_terminus_environment -- deploy:hook --no-interaction") ->run()