4

Why do i need to run php bin/magento setup:static-content:deploy each time i clear the cache and also running the same command is time consuming.

I enabled apache rewrite! But still why ?

asked Jul 31, 2016 at 15:11
3
  • I had the same issue. Try to delete these folders: pub/static/frontend/<Vendor>/*, var/view_preprocessed/*, var/cache/*, then set your environment to developer with php bin/magento deploy:mode:set developer. After that Magento will create symlink as KAndy says. Sadly you have to do this each time you change a .less file in order to regenerate compiled files. Hope this help you. When you go to production you will need to set the environment to production and run setup:static-content:deploy. Commented Jul 31, 2016 at 17:23
  • i had enabled the developer mode, i deleted the pub static and var view folders, but i am not dealing with .less files, i change the xml files and php code and the css and js does not seem to generate properly in admin which works after i run the content deploy command. Commented Aug 1, 2016 at 5:17
  • This unfortunately is happening in only one of my instances, works properly in other instance of magento2 Commented Aug 1, 2016 at 5:18

1 Answer 1

4

In development, you don't need to run setup:static-content:deploy at all. Moreover, if you run this command you will break auto update of files on page update because deploy copies files instead of creating symlink

Ryan Hoerr
12.3k7 gold badges50 silver badges55 bronze badges
answered Jul 31, 2016 at 16:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.