How to make Magento 2 development sites fast?

You can use this vagrant box https://github.com/EcomDev/fast-hypernode.

I use it and it is quite fast. In developer mode with cache disabled and xdebug a page refresh is about 2-3 seconds.

Or you can use the vagrant box provided by magestead: http://www.magestead.com/

  • use php7.
  • use gulp for generating css and js (faster than grunt). You can try the already built configuration by snowdog (ready in 2 minutes): https://github.com/SnowdogApps/magento2-frontools
  • use 3gb of ram if doing testing.
  • disable only the cache that you need. If you're doing frontend you don't need to disable any cache.
  • use livereload or browsersync for frontend development so that you don't need to reload pages.

Understand what magento commands do and when to run them. If you're running a lot of setup:static-content:deploy then you'll go mad seeing those dots. Grunt or gulp don't know about @magento_import so that's why when you add or remove files you need to run dev:source-theme:deploy which is much faster than the above one.

What doesn't improve:

Unless you have over 100k products redis makes no difference so don't bother (http://www.developers-paradise.com/wp-content/uploads/2016/05/05-Yaroslav-Rogoza-Magento-2-performance-comparison-in-different-environments.pdf).

Currently because of how magento2 uses requirejs (2mb of js), http2 makes no difference either.


Depending on what type of development you plan on doing you might find switching to client side css compilation improves a development sites speed significantly

Stores > Configuration > Advanced > Developer > Front-end development workflow

Switch to Client side less compilation

Tags:

Magento2

Cache