I use Symfony 2.8.
I modified a controller file and I loaded the changes on the production server, I can see the changes without the need to use php app/console cache: clear and without use app_dev.php.
If I modify a Twig file everything does not happen and I have to clean the cache to transport the changes from app_dev.php to production environment.
why?
Controllers aren't cached in Symfony. There is no time consuming logic involved in reading controllers (it's just PHP code anyway).
When deploying to production server, always make sure to clear the cache using the cache:clear command. Also make sure to remove the app_dev.php file and any other, not used, PHP file in the web/ directory. You shouldn't run the dev environment on the production server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With