1

We changed one image file at this location and now we want to deploy it on live:

app/design/frontend/theme/theme1/web/images/sample.jpg

We learned that the only way to deploy static files in production is:

php bin/magento setup:static-content:deploy en_AU -f

This command takes time to complete and we need to take the site down for around 30 minutes just to update production. This isn't useful for us.

Do you have any recommendation to optimize the process of updating small static files?

  • 2
    You can try to replace the image in both pub and theme folder. The quick reflection of such data is from pub folder. And when the change has reflected you can run the deployment command by the time users will not feel any change. – Gagan Jul 24 '18 at 13:29
1

@LAW, is correct. For the current version of Magento 2, it is impossible to deploy selected static files. What we do is we keep our Magento 2 websites's mode to developer. If you are in production mode, the fastest route is to manually replace or update the file in your pub/static files. In your question, you deploy in en_AU, so path should be similar below:

pub/static/frontend/theme/theme1/en_AU/images/sample.jpg

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.