Skip to main content

Posts

Showing posts from May, 2024

Magento 2: How to enable cache for a custom EAV attributes?

To prepare for the certification exam, the candidate should know about different cache types and their purpose. The cache is an important and crucial part of the website's performance. One of the caches is the "EAV types and attributes" cache. You can check the list of caches in Magento Admin and by using console commands. Below is the screenshot of the list of caches in admin under System -> Cache Management As of version 2.3.4, Commerce caches all system EAV attributes as they are retrieved. Caching EAV attributes in this manner improves performance, because it decreases the amount of insert/select requests to the DB. However, it increases cache network size as well. Developers can cache custom EAV attributes by running the below command. bin/magento config:set dev/caching/cache_user_defined_attributes 1 This can also be done from the Admin while in Developer mode by setting Stores > Settings Configuration > Advanced > Developer > Caching Settings > Ca...