When auto_reload option is true, it means when a template file is modified, Twig recompiles the file and then render the content.
Question : Is auto_reload option set to true recommended in production environment?
In my opinion, it should be set to true in production because If i am using GIT and one of my twig template file has new changes, and then i update my production codes using 'git pull', i dont have to clear cache anymore, Twig automatically detects that this template file has been changed and need to recompile it. So when the template file is being rendered, it will be rendered with the most recent changes.
Would anyone agree with me? If not, then what would you recommend?
I don't agree with you :) auto_reload should be set to false in production. Moreover, I don't recommend to do a git pull to do a live update of the production code.
I recommend you to set a deployment mechanism which is safer for your code. This can be as easy as a script console or based on tools such as Capistrano or Deployer.
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