Caches are a very important part of Magento because, without cache, Magento is practically unusable due to its low speed. Magento has its own cache by default, but you can set other caches such as Redis, varnish, mem cache, etc.
In this article on the WeGento site (types of cache in Magento), we try to teach the most important parts that are cached by Magento, as well as how to Enable/Disable or empty the cache in this part of the Magento 2 tutorial.
Related posts: How to Add a Video to a Page in Magento 2?
Cache settings section in Magento
First, let’s go to the cache settings section and check the status of each cache. To enter the cache section:
Go to the admin panel > System > click on cache management.
Related posts: how to enable Captcha in Magento
Well, here we can execute all kinds of actions on the cache.
- enable: enable cache (s)
- disable: disable cache (s)
- refresh: Refresh cache (s)
To execute each action, check one or more caches, then select the action and click on submit to apply the desired action. To display the status of caches we look at the status. Whenever a cache has been invalidated, we rebuild it by selecting that cache and applying the refresh action.
Caches are a very important part of Magento because, without cache, Magento is practically unusable due to its low speed. Magento has its own cache by default, but you can set other caches such as Redis, varnish, or mem cache, etc on it.
Types of Magento caches
In the list below, we will try to find and explain the most important caches, which are about 14 by default, and which section each one is for.
Related posts: how to change the favicon in Magento 2
Configuration Cache
This cache includes admin settings and must be emptied after any changes are made to the admin settings.
Layouts Cache
This cache is embedded in XML layers. In general, most of the time we will have a final XML file. For example, we have a final menu.XML file that eventually all the files are combined by Magento and the final menu.xml is created. This is a cache for developers. If there is a change in the XML files, this cache has to be updated.
Blocks HTML output Cache
This cache is the most important cache on Magento and caches the output of the blocks. What a block is and how Magento blocks should be taught in a few sessions is not so easy.
Just be careful, if the speed of your store is too low, it is most likely that this cache is disabled, or if you have changed it but you don’t see it on the front, the problem will still be solved by refreshing this cache.
Collections Data Cash
Collections are groups of information that are extracted from the database and we are faced mostly with them in the ORM database.
This cache stores the output information from the database, so it can be said that the cache is very important, and by enabling it, the speed of the store becomes much better than before.
If you are familiar with the structure of the Magento database, especially the EAV, you can see how effective this cache is.
Reflection Data Cache
This cache caches the structure of Magento APIs. It’s not hard to explain, but since we have to explain the whole Magento API system and what role the interfaces play in this structure and this issue takes time So we postpone it to another time. We will probably explain this in full in future tutorials.
Related posts: WooCommerce Vs Magento: Which one is better?
Database DDL operations Cache
This cache is usually refreshed by Magento itself and is about the structure of the database. If you have changed one of the tables by the extension and the data is not saved yet, it can be related to this part.
EAV types and attributes Cache
This cache stores different types of EAV and types of attributes. Eav types include customer, product, address, etc. Attribute type also specifies the type of attributes such as text, numeric, etc.
Customer Notification cache
This cache contains messages that are displayed to the admin. This cache has just been added and I still haven’t had time to check where it works.
Page Cache
This cache works like the Blocks HTML output cache, except that it also caches image, CSS, and JavaScript files. If you are working on Front, you can see the results of the changes by clearing this cache.
Translations Cash
This cache stores translation, so if the translation of any section changes, this cache should be refreshed.