Search code examples
cachingroutessymfony1yaml

In Symfony how can you instantely cache the routing.yml?


I have a file located at [application]/config/routing.yml, when I change something in there, the changes aren't active. This probably has to do with the cache as when I go into that directory [cache]/[application]/prod/config the currently active file can be seen config_routing.yml.php.

The lifetime of the cache is generally 86400 seconds, is there a way that I can immediately view/activate the changes?


Solution

  • Use the dev environment instead of the prod environment. You can access the dev environment by going to your index_dev.php file instead of the index.php file:

    http://localhost/index_dev.php

    The dev environment by passes the cache so you can see your changes immediately. You can also run a clear cache command after each change to see your changes in the prod environment:

    symfony cc