Managing Magento 2 cache via the command line

Cache management is one of the new optimized key features in Magento 2. We will be using the following cache types:

Cache types

Cache type code name




Magento collects configuration from all modules, merges it, and saves the merged result to the cache. This cache also contains store-specific settings stored in the filesystem and database.

Clean or flush this cache type after modifying configuration files.



This is the compiled page layout (that is, the layout components from all components).

Clean or flush this cache type after modifying layout files.

Block HTML output


This is the HTML page fragments per block.

Clean or flush this cache ...

Get Magento 2 - Build World-Class online stores now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.