2

I have a very simple question. Which magento commands cause the removal of

var/cache/ 
var/generation/
var/di/

Folders and which bin/magento commands create them again.

9

var/cache is cleared by php bin/magento cache:flush. It rebuilds on the fly as data is cached by Magento (there's no command to rebuild, it just happens).

var/di and var/generation are cleared by php bin/magento setup:upgrade, or manually (like executing rm -rf var/di var/generation from site root--be very careful with this!). You can rebuild them by running the command php bin/magento setup:di:compile. If you are in non-production mode, you can leave them and Magento will rebuild the generated sources on the fly (but it'll be a little slower while that happens).

0

must be php bin/magento cache:flush command

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.