1

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?

  • Please try Flush Javascript/CSS cache from admin panel and then check. @xxx – Dhaduk Mitesh Mar 27 '18 at 10:52
  • @DhadukMitesh Before I deploy, I ran this command magento cache:flush. I think this will remove all cache? – Magento Learner Mar 27 '18 at 11:02
  • 1
    First you execute php bin/magento setup:static-content:deploy. after that Flush Javascript/CSS cache from admin panel. – Dhaduk Mitesh Mar 27 '18 at 11:04
  • Working or not? @xxx – Dhaduk Mitesh Mar 27 '18 at 11:22
  • I tried to flush js/css cache i admin after static-content:deploy. The css files still not updated in pub/static/frontend folder. But if I remove everything from pub/static/frontend folder then deploy, it will work. but as I mentioned in the question, removing everything from pub/static will break my site for a few moment, which I want to avoid. – Magento Learner Mar 27 '18 at 11:23
0

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 Mar 27 '18 at 10:39
  • yes, after remove, site is possible to down, but you must remove everything from var/view_preprocessed/ – St3phan Mar 27 '18 at 10:42
  • Run commands from answer – St3phan Mar 27 '18 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 Mar 27 '18 at 10:45
  • I updated my answer, try now. – St3phan Mar 27 '18 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.