Magento 2 Cache Type and how to clear cache in Magento 2
Magento 2 comes with advance Cache management in order to handle best performance optimization.
How to clear cache in Magento 2
Clear cache from admin section:
- Login to admin section
- Click on System (gear shape icon)
- Click on Flush magento Cache button near top right
- Select cache type and click on flush button
Clear cache from command line
php bin/magento cache:flush
Types of Cache in Magento 2
Friendly name | Type name | Description |
---|---|---|
Configuration | config | Magento 2 collects configuration from all modules, merges it, and saves the merged result to the cache including store configuration. |
Layout | layout | Its compiled page layout. It contains layout from all the components |
Block HTML output | block_html | HTML page fragments per block from all the modules |
Collections data | collections | Results of database queries |
DDL | db_ddl | Database schema |
Entity attribute value (EAV) | eav | Value of eav attributes (store labels, links to related PHP code, attribute rendering, search settings) |
Page cache | full_page | Generated HTML pages |
Reflection | reflection | Removes a dependency between the Webapi module and the Customer module. |
Translations | translate | Merged translations from all the modules |
Integration configuration | config_integration | Compiled integrations(Clean or flush this cache after changing or adding integrations.) |
Integration API configuration | config_integration_api | Compiled integration API |
Web services configuration | config_webservice | Webservice API structure |
Enable/Disable cache in Magento 2
php bin/magent cache:enable –TYPENAME—
if you omit the typename then by default it will enable/disable all the modules.
Flushing specific type of cache
bin/magento cache:flush –TYPENAME—
Omitting the typename flush all the cache types.
Clean specific type of cache
php bin/magento cache:clean –TYPENAME—
Omitting the type name clean all the cache types.
Chandra Shekhar
Latest posts by Chandra Shekhar (see all)
- Best practices for micro service design - January 23, 2022
- Spring Boot - January 23, 2022
- Java - January 23, 2022
Recent Comments