Magento Caching

1)su <Magento file system owner> -s /bin/bash -c <command>
2) export PATH=$PATH:/var/www/html/magento2/bin

View the cache status

magento cache:status

Enable or disable cache types

Magento cache:enable [type] ... [type]
magento cache:disable [type] ... [type] 

Clean and flush cache types

magento cache:clean [type] ... [type]
magento cache:flush [type] ... [type]
Go to System > Tools > Cache Management. Flush Cache Storage is equivalent 
to magento cache:flush. Flush Magento Cache is equivalent to
 magento cache:clean.
 
Cache type “friendly” name Cache type code name Description
Configuration config Magento collects configuration from all modules, merges it, and saves the merged result to the cache. This cache also contains store-specific settings stored in the file system and database.

Clean or flush this cache type after modifying configuration files.

Layout layout Compiled page layouts (that is, the layout components from all components).

Clean or flush this cache type after modifying layout files.

Block HTML output block_html HTML page fragments per block.

Clean or flush this cache type after modifying the view layer.

Collections data collections Results of database queries.

If necessary, Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache.

Clean or flush this cache type if your custom module uses logic that results in cache entries that Magento cannot clean.

DDL db_ddl Database schema.

If necessary, Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache.

Clean or flush this cache type after you make custom changes to the database schema. (In other words, updates that Magento does not make itself.)

One way to update the database schema automatically is using the magento setup:db-schema:upgrade command.

Entity attribute value (EAV) eav Metadata related to EAV attributes (for example, store labels, links to related PHP code, attribute rendering, search settings, and so on).

You should not typically need to clean or flush this cache type.

Page cache full_page Generated HTML pages.

If necessary, Magento cleans up this cache automatically, but third-party developers can put any data in any segment of the cache.

Clean or flush this cache type after modifying code level that affects HTML output. It’s recommended to keep this cache enabled to because caching HTML improves performance significantly.

Reflection reflection Removes a dependency between the Webapi module and the Customer module.
Translations translate Merged translations from all 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 APIs.
Web services configuration config_webservice Web API structure.

Leave a Comment