Symfony 4, disable twig cache

10,888

With a slight delay, but...
Addition of cache: false to twig config should solve problem.

There you have full config options of twig: https://symfony.com/doc/current/reference/configuration/twig.html

Share:
10,888
spacecodeur
Author by

spacecodeur

Updated on June 28, 2022

Comments

  • spacecodeur
    spacecodeur almost 2 years

    From symfony 4, how doI disable the twig cache ?

    When I edit an .html.twig file, I must clear the cache via the command './bin/console clear:cache' for me to see the updated result in my browser. I would like it to not execute each time the shell command.

    In the config/packages/twig.yaml configuration file, I added :

    auto_reload: '%kernel.debug%'
    

    But nothing changes, I must still execute the cache:clear command each time I modify my templates files..