Summer Sale! Save 15%
on any Shared Hosting Plan & Location.
 View More

How to Manage the Cache in Magento 2

Overview on Clearing the Cache in Magento 2 and the available Caching options

The Caching system of Magento 2 will help your Store perform better and faster especially when you add more content to it. In this tutorial, we will talk about the different cache types and how to flush the cache of your Store.

 

To access the Cache, you will need to login to your admin dashboard and navigate to the System>Cache Management section.

 

Accessing the Cache Management Menu in Magento 2

 

To flush the entire Magento 2 cache, simply click on the big orange button titled Flush Magento Cache.

 

Flushing the Magento 2 Cache

 

Now let us talk about the different types of cache at your disposal:

 

  • Configuration This Cache contains configuration and store specific settings. You will need to flush it after modifying configuration files
  • Layouts – Contains the compiled page layout from all components. Flush after modifying layout files
  • Blocks HTML output – Contains HTML page fragments per block. Flush after modifying the view layer of your store
  • Collections Data – Automatically cleaned by Magento, this cache type collects results from database queries. Custom modules may write entries which Magento will not be able to clean by itself, in those cases flush the cache manually
  • Reflection Data – Any API interfaces reflection data will be cached here
  • Database DDL operations – Automatically cleaned by Magento, this cache type holds custom changes to the database schema
  • EAV types and attributes – This cache collects metadata regarding the entity attributes
  • Integrations Configuration – Caches the compiled integrations on your store. Clean after adding new or changing existing integrations
  • Integrations API Configuration – Caches the API configuration of your Store’s Integrations
  • Page Cache – This is the cache you will need to flush frequently as it is connected to the HTML pages of your store
  • Translations – Merged translations from all modules will be cached via this cache type
  • Web Services Configuration – Caches the Web API Structure of your website

 

For example, when you change the HTML output of a page, you will receive a notification regarding the change and a link to the Cache Manager so you can refresh the Page Cache.

 

System Message about the need of refreshing a Cache type in Magento 2

 

Select the Page Cache, from the drop-down action menu select the Refresh option and click the Submit button.

 

Marking the Page Cache for refreshing

 

You also have the Additional Cache Management options:

 

  • Catalog Images Cache – Flush this cache, if you have catalog images that have been cached but are no longer needed
  • JavaScript/CSS Cache – This cache combines both JavaScript and CSS. If you have changed your theme but you are not seeing the correct layout, you will want to flush this cache
  • Static Files Cache – All Static Files cache can be flushed from here

 

Congratulations, you now know how to manage the cache of your Magento 2