3

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?

1 Answer 1

5

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, 2021 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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