Symfony2 disable cache? Symfony2 disable cache? symfony symfony

Symfony2 disable cache?


I'm assuming you're using the Twig engine, (the default templating engine for Symfony2). To disable caching in twig, so that you do not have to keep clearing the cache like so:

rm -rf app/cache/*

Navigate to your app config file (by defualt will be located in ../app/config/config.yml from your root directory). Scroll to the twig configuration settings (under twig:) and change the cache value (which should be pointing to the cache directory) to false like so:

twig:    cache:  false

If you do not see any cache configuration entry, simply add the line above.

It may also be helpful to checkout the configuring reference for the Twig bundle: http://symfony.com/doc/2.0/reference/configuration/twig.html

After editing your config_dev.yml file, go to your terminal and run:

app/console cache:clear


Okay, regarding your clarification the solution simply is to use the dev-environment through the front-controller web/app_dev.php. Then sf2 keeps track of your adjustments and you don't have to clear the cache.