2

We have this large website where we would have to deploy html changes in Twig quite often. I'm looking for a solution to clear the Twig cache ONLY. So we do not have to do a general cache rebuild, which consumes a lot of CPU each time. drush cc render does not work, twig html still cached. Any suggestions?

2

Invalidate the twig cache first, like this:

drush php-eval "\Drupal::service('twig')->invalidate();" 
drush cc render
1
  • This may be the correct answer, but I've found that this can be as slow as running "drush cr". Also, I found that the site will break if twig templates are deleted (and that does not happen with "drush cr")
    – Pere
    Oct 22 '21 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.