I'm running Magento 2 in production mode.
I made some changes in my theme's css files.
I try to make the css change reflecting on the live site, by using following command.
php bin/magento setup:static-content:deploy en_AU en_US
I can't see the css files are updated in pub/static folder.
I have flushed cache php bin/magento cache:flush before and after static-content deploy.
Did i miss any steps?
Update,
By removing everything from the pub/static/frontend folder, then deploy static-content will make css changes reflecting on the site. But this will break site for a few moment. There's no way to implement css / js changes in a product mode without breaking the site?
1 Answer 1
Run orders in the following order:
rm -Rf var/view_preprocessed/* var/*cache/* pub/static/frontend/*
php bin/magento setup:static-content:deploy
php bin/magento cache:flush --all
In production mode, you have a CSS and JS files cache, this cache is must remove after that is must refresh cache, screen.
-
If I remove everything from pub/static/frontend/* then my site will broke right? I know I can then deploy static-content right away, but I cant afford to have the site down for 1 or more minutes.Magento Learner– Magento Learner2018年03月27日 10:39:45 +00:00Commented Mar 27, 2018 at 10:39
-
yes, after remove, site is possible to down, but you must remove everything from
var/view_preprocessed/St3phan– St3phan2018年03月27日 10:42:28 +00:00Commented Mar 27, 2018 at 10:42 -
Run commands from answerSt3phan– St3phan2018年03月27日 10:42:59 +00:00Commented Mar 27, 2018 at 10:42
-
thanks, but then we can come to a conclusion that when running Magento 2 in production mode, there's no way to get css / js changes on live site without breaking the site for a few moment?Magento Learner– Magento Learner2018年03月27日 10:45:05 +00:00Commented Mar 27, 2018 at 10:45
-
1this is command for clear all
php bin/magento cache:flush --all, if not working, I recomand you to clear from admin and after that refresh to all caches.St3phan– St3phan2018年03月27日 10:56:20 +00:00Commented Mar 27, 2018 at 10:56
php bin/magento setup:static-content:deploy. after that Flush Javascript/CSS cache from admin panel.