Manage cache in magento 2

For cache management in Magento 2, login to Magento 2 server. Change your directory to <Magento 2 install directory>/bin. Type the below command to know the status of the cache

php magento cache:status

You will get result list. You would see the cache types followed by either 0 or 1. If 1 means cache is enabled and 0 means it is disabled

                    config: 0
                    layout: 0
                block_html: 0
               collections: 0
                    db_ddl: 0
                       eav: 0
                 full_page: 0
                 translate: 0
        config_integration: 0
    config_integration_api: 0
         config_webservice: 0

To enable the all caches run below command



php magento cache:enable

To enable the caches for particular type(s) run below command. Like we are doing here for config, layout and block_html.

php magento cache:enable  config layout block_html

To disable the all caches run below command

php magento cache:disable 

To disable the caches for particular type(s) run below command. Like we are doing here for config, layout and block_html.

php magento cache:disable  config layout block_html

To clean and flush cache use below commands with type[s] or without type(s) to flush/clean all types.

php magento cache:clean [type] ... [type]
php magento cache:flush [type] ... [type]

Here [type] ... [type] is space separated types like config layout and block_html etc.

php magento cache:clean config layout block_html
php magento cache:flush config layout block_html

Command "php magento cache:clean" deletes all items from enabled Magento cache types only. Disabled cache types are not cleaned. And command "php magento cache:flush" purges the cache storage.

And cache can be managed through admin panel. Go to System > Tools > Cache Management. Here you can flush and clean the cache which is equivalent to "php magento cache:flush" and "magento cache:clean" respectively.