We have an issue with the way de Twig cache file names are generated. We have a load-balanced Drupal setup with two Drupal webservers. Both servers have their own copy of the Drupal source files. The modify timestamps of the source files differ across the two webservers. Because of this, new Twig cache files keep being generated over and over again. This is because with every use of the cached Twig files the timestamps are checked and compared to the twig_extension_hash thats is kept in de Drupal state. If the timestamps do not match the twig_extension_hash, a new twig_extension_hash is generated based on the timestamp and a uniquely generated id (see the twig_cache_prefix).

We made a quick patch by removing the timestamp part from generating the twig_cache_prefix. But I wonder if there is a better solution for this problem?

CommentFileSizeAuthor
TwigExtensionPass.php_.patch851 bytesltimmers

Comments

ltimmers created an issue. See original summary.

ltimmers’s picture

Category: Support request » Bug report
idebr’s picture

Status: Active » Closed (duplicate)