In Drupal 8, what if my theme does not render as expected?
Twig is used for Drupal 8 theming, and it relies on having its own cache of compiled Twig templates, which is separate from other caches that are cleared with the
drush cr all command in Drupal 8. Drupal 8 websites on Acquia Cloud Enterprise can run into issues where cached Twig templates fall out of sync on different web server instances when changes to themes are being made and a code deployment has been performed. When you make changes to themes in Drupal 8 websites on Acquia Cloud Enterprise, connect to each web server instance and run a command like this, to remove the outdated Twig templates:
drush @[sitename].[prod] --uri=http://[site_URL]/ ev '\Drupal\Core\PhpStorage\PhpStorageFactory::get("twig")->deleteAll();'
This workaround can temporarily be automated via a mix of Cloud Hooks and Cloud API's https://cloudapi.acquia.com/#GET__sites__site_envs__env_servers__server-instance_route
The problem arises from having separate copies of the compiled Twig templates on each web server instance and (the related Drupal core issue https://www.drupal.org/node/2752961 ).