Cache In Magento 2

View the cache status

To view the status of the cache, enter
                magento cache:status 

A sample follows:
                    config: 1
                    layout: 1
                block_html: 1
               collections: 1
                    db_ddl: 1
                       eav: 1
                 full_page: 1
                 translate: 1
        config_integration: 1
    config_integration_api: 1
         config_webservice: 1


cache types in Magento2 :




  1. config
  2. layout
  3. block_html
  4. collections
  5. db_ddl
  6. eav
  7. full_page
  8. translate
  9. config_integration
  10. config_integration_api
  11. config_webservice
Enable or disable cache types
This command enables you to enable or disable all cache types or only the ones you specify. Disabling cache types is useful during development because you see the results of your changes without having to flush the cache; however, disabling cache types has an adverse affect on performance.

Command options:
magento cache:enable [type] ... [type]
magento cache:disable [type] ... [type] 

where

  • omitting [type] enables or disables all cache types at the same time.
  • type is a space-separated list of cache types.


To list cache types and their status, enter
                         magento cache:status

For example, to disable the full page cache and the DDL cache, enter
                 magento cache:disable db_ddl full_page

It changed cache status:
                    db_ddl: 1 -> 0
                 full_page: 1 -> 0

Enabling a cache type automatically clears that cache type.
Clean and flush cache types

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.

Command usage:
magento cache:clean [type] ... [type]
magento cache:flush [type] ... [type]

where
[type] is a space-separated list of cache types. Omitting [type] cleans or flushes all cache types at the same time.

For example, to flush all cache types, enter
                           magento cache:flush

Flushed cache types:

  1. config
  2. layout
  3. block_html
  4. collections
  5. db_ddl
  6. eav
  7. full_page
  8. translate
  9. config_integration
  10. config_integration_api
  11. config_webservice

Remember This Line always :     magento cache:flush