I'm trying to fully understand the Laravel (5.1) artisan optimize
command and best practices, but the documentation seems lacking. I don't have Composer installed on the production server so, specifically, I want to know what files are modified or created when running artisan optimize --force
on development that must get pushed to production. The goal being not to blow up the app in production! After running the command, I see the following files have been modified:
\bootstrap\cache\compiled.php
\vendor\composer\ - the entire directory
\vendor\autoload.php
Am I overthinking this, or do I just push these files to production and I'm good to go? Also, what is the best practice regarding when to run artisan optimize
? Each time a new model is created? What about controllers, routes and helper classes?
Lastly, I see the \bootstrap\cache\compiled.php
file is a whopping 548KB and almost 17K lines! Is that really considered optimal?