Magento 2: What is difference between Cache Clean & Cache Flush?

To purge out-of-date items from the cache, you can clean or flush cache types:

  • Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not affect other processes or applications because it cleans only the cache that Magento uses.

    Disabled cache types are not cleaned.

  • Flushing a cache type purges the cache storage, which might affect other processes applications that are using the same storage.

Flush cache types if you’ve already tried cleaning the cache and you’re still having issues that you cannot isolate.

Source: https://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cache.html#config-cli-subcommands-cache-clean


php bin/magento cache:clean

Cleaning a cache type deletes all items from enabled Magento cache types only. In other words, this option does not affect other processes or applications because it cleans only the cache that Magento uses.

Disabled cache types are not cleaned.

php bin/magento cache:flush

Flushing a cache type purges the cache storage, which might affect other processes applications that are using the same storage.

Reference: DevDocs Manage the cache


Quoting Fabrizio Branca for this one:

(...) Magento that comes with those two different actions in the first place (you'll also find two buttons on the cache management page).

While cache:clean deletes the cache storage by tags cache:flush will wipe out everything.

There are two major differences here:

  • some things are stored into the cache without the proper tags. cache:clean will not delete those.
  • other things might be using the same cache storage (this is not recommended, but sadly sometimes this is the case). Flushing the cache will result in everything being deleted. So if multiple Magento instances use the same cache storage or if you store your sessions in the same Redis database you're using for the cache (please don't! :) then they will also be gone.

Other resources:

  • Technical explanation and details (From Magenteiro) (In Portuguese)
  • Cache management (official docs)
  • About the 10 cache types in Magento (from Mageplaza's blog)