Uncategorized

Twig Caching Issues in Acquia Cloud Enterprise

I’ve recently run into an issue where my site (on Acquia Cloud Enterprise) has node displays that were flip-flopping between an older version of a Twig template file, and the most recent version. I tried all combinations of drush cr, varnish cache clearing, and clearing the cache through the Drupal UI.

After reading through No reliable method exists for clearing the Twig cache, I landed on this page at Acquia: https://support.acquia.com/hc/en-us/articles/360005167754-Drupal-8-Twig-cache

I SSH’d into the production server I always SSH into, and I ran the command as shown. I did this repeatedly. I did a drush cr after. I did a drush cr before. Nothing was working. My pages were showing up with the old template, or the new template, and it seemed to be at random.

Ultimately I re-read the documentation page, more thoroughly this time, and discovered this: “connect to each web server instance and run a command like this…

Ahah! EACH web server.

So, I logged into the Acquia Cloud interface, found the other production server’s connection string (myuser@someserver.prod.hosting.acquia.com), connected, and ran the same command. After another drush cr all of the pages were using the new template.

That’ll teach me to jump straight to executing commands without reading the instructions carefully.

Leave a Reply

Your email address will not be published.