Magento 2 - Manage cache
Check cache status
Following is the command to check the status of the cache:
php bin/magento cache:status
Your result should look something like this:
Current status:
config: 1
layout: 1
block_html: 1
collections: 1
reflection: 1
db_ddl: 1
eav: 1
customer_notification: 1
full_page: 1
config_integration: 1
config_integration_api: 1
translate: 1
config_webservice: 1
Flush / Clean Magento cache
Flushing or cleaning is cache is done when you want to clear outdated items from the cache.
The difference between flushing and cleaning cache:
- Flushing the cache clears the entire cache storage. If multiple Magento instances use the same cache storage, this action will affect such processes or applications. Use this action only once you've tried cleaning cache and you are still having the same issues.
- Cleaning cache only deletes all the items from enabled Magento cache types. Unlike flushing cache this action affects only the cache type Magento uses, and hence it will not affect other processes or applications using the same storage.
Flush cache:
php bin/magento cache:flush [type ...]
Clean cache:
php bin/magento cache:clean [type ...]
[type ...]
is a list of cache types separated by
space. This is an optional argument. Omitting this argument will flush or clean all the cache types.
Enable / Disable cache types
Enable cache type:
php bin/magento cache:enable [type ...]
Disable cache type:
php bin/magento cache:disable [type ...]
Optional argument [type ...]
is a list of types seperated by space. Omiitting the [type]
will result in all cache types being enabled or disabled.