You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a cache type is super clear. But when it comes to using it there are questions that come up.
The biggest question is why when you create a cache type and declare it in cache.xml don't you use it instead of using CacheInterface (as shown). Every Magento module uses its own type in the constructor and saves/loads data through it. That grants you automatic checking if the cache is enabled or disabled (if you use CacheInterface which instantiates Magento\Framework\App\Cache\Proxy that does not work) and autopopulating the default cache tag of your custom cache type (if you use CacheInterface you are responsible for adding your tag).
What changes do you propose?
If the above is correct. I propose to show the usage of the newly created cache by injecting your own type and using it instead of CacheInterface. Feel free to correct my why this should not happen.
Anything else that can help to cover this?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Which topic?
https://developer.adobe.com/commerce/php/development/cache/partial/cache-type/
What's wrong with the content?
Creating a cache type is super clear. But when it comes to using it there are questions that come up.
The biggest question is why when you create a cache type and declare it in cache.xml don't you use it instead of using CacheInterface (as shown). Every Magento module uses its own type in the constructor and saves/loads data through it. That grants you automatic checking if the cache is enabled or disabled (if you use CacheInterface which instantiates Magento\Framework\App\Cache\Proxy that does not work) and autopopulating the default cache tag of your custom cache type (if you use CacheInterface you are responsible for adding your tag).
What changes do you propose?
If the above is correct. I propose to show the usage of the newly created cache by injecting your own type and using it instead of CacheInterface. Feel free to correct my why this should not happen.
Anything else that can help to cover this?
No response
The text was updated successfully, but these errors were encountered: