Run this to reflect Magento 2 code changes
So its very annoying when you change something in Magento 2 code and it change doesn’t reflect. As a practice i always run following commands to make sure magento is reflecting the latest code
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
You can always enable developer mode but in my practice i want to rely on manual commands
In case your website is live it better to enable maintenance mode before you run above commands
# to enable maintenance mode
php bin/magento maintenance:enable
# to disable maintenance mode
php bin/magento maintenance:disable
In case of 911 or when the sucker is really stuck.. apply following code red commands and repeat the above steps again
rm -rf var/cache/*
rm -rf generated/*;
rm -rf pub/static/*;
rm -rf var/view_preprocessed/*;
If it still doesn’t work something might be wrong in your code. So roll back and take your time to resolve it.
Happy coding..