magento 2 flush cache command line

  Last Update - 2023-06-08

How to flush Cache Command Line in Magento 2 is a general topic when you guys using Magento store. Magento 2 has 12 cache types by default. There are 5 simple commands to manage cache in command line. In this post I will show you to conduct each command line step by step. 

Magento 2 cache:

  • Go to Magento root directory
  • Type: php bin/magento cache:clean and php bin/magento cache:flush
  • Finish! Go to your Magento store and check the result.

Check cache status

First of all, let show cache status by the following command line: 

php bin/magento cache:status


Clean Cache command line

php bin/magento cache:clean

flush cache storage used by cache types(s) command line

The cache storage may contain additional data such as server cache.


php bin/magento cache:flush


Disable Cache command line

The following command will disable all cache types

php bin/magento cache:disable

If you would like to disable specific cache type, you should type command line

php bin/magento cache:disable CACHE_TYPE


php bin/magento cache:disable config

Enable Cache command line

It is similar to how to Disable cache all types and specific cache type

Enable all cache types

php bin/magento cache:enable

Enable specific cache type

php bin/magento cache:enable CACHE_TYPE


php bin/magento cache:enable layout

Brijesh Patel

Share on Facebook Twitter LinkedIn