1

Today is my first day using Magento 2 (I know Magento 1).

I'm running Magento 2.1.3 locally on MAMP, PHP v 7.0.13.

I had installed Magento 2, I was trying out creating a new theme, and the site was running OK.

I was trying to switch the parent theme and not seeing expected results, so I (naively):

  • 1) disabled the Cache
  • 2) flushed Static Files cache.

I did this in the Cache Management admin area. I didn't realize all hell was going to break loose when I did this...

Since then, I can barely load pages. I could see files were being generated to pub/static. This has been happening for about an hour and a half.

When I did this, Magento was in default mode. I've now switched to developer mode (about 20 minutes ago) as per "Set the Magento mode":http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html

rm -rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
magento deploy:mode:set developer

...but I'm still waiting for minutes (like 10 minutes or more) for pages to load, it's just absolutely crawling. It seems like the page renders but it doesn't finish loading and there are JS issues (I can't use the admin menu, etc.) I also can't see icons like the cart icon, menu icons...

I thought the site was not dependendent on pub/static when in developer mode? Static files still seem to be being generated in pub/static (on the fly??)

I'm on a Macbook Air with 8GB memory, 1.7 GHz Intel Core i7, and the fans going crazy, CPU is maxed out. Running Magento 1 was possible, although sometimes slow, but never this slow!

I have also tried to enable/disable Caches and enabling caches makes things faster. But surely (like Magento 1) while developing, it makes sense to keep caches disabled?

Any suggestions? Do I just need to wait and have more patience?

Thank you.

  • From my experience, need to enable Cache when working with Magento 2. – Khoa TruongDinh Feb 4 '17 at 15:57
  • @KhoaTruongDinh Even during development? – Sarah Feb 4 '17 at 15:58
  • Yes, using command line to clean or flush cache if you want to see your new change. – Khoa TruongDinh Feb 4 '17 at 15:59
  • If you have just started with Magento 2, you will get headache with it. The performance is one of "the big issues" for you. You should upgrade your computer or buy new one. However, after working few months, you will feel better. – Khoa TruongDinh Feb 4 '17 at 16:04
  • @KhoaTruongDinh I've read about using magento setup:static-content:deploy - do I also need to use that whenever I make changes, as well as flushing/cleaning the cache? – Sarah Feb 4 '17 at 16:10
1

From my experience:

When working with Magento 2 (especially on your local machine), you need to enable Cache. Using command line to clean or flush cache if you want to see your new change.

For the static contents(js, html templates) under pub/static, you can edit directly the file to see the new changes. Need to disable or clear Browser Cache also. If still not see the changes, try to clear Magento Cache. If it works, copy it to the "real" file in your module.

You should set the mode to developer mode during development, because, you will don't need to run di compile again and again.

  • 1
    I have re-enabled the cache and this definitely seems to have helped, thank you. I would accept your answer but I just want to see if any alternative answers come up, particularly with regards editing static view files directly... that just seems like a massive duplication of work, but I appreciate I don't have enough experience yet to comment on it. Thank you for your advice. – Sarah Feb 4 '17 at 16:27

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.