Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a custom created cache type is not clearly explained #187

Open
1 task done
zondario opened this issue Aug 25, 2023 · 0 comments
Open
1 task done

Using a custom created cache type is not clearly explained #187

zondario opened this issue Aug 25, 2023 · 0 comments

Comments

@zondario
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

@github-project-automation github-project-automation bot moved this to 🆕 Ready for Grooming in Commerce - Issues Aug 25, 2023
@dobooth dobooth moved this from 🆕 Ready for Grooming to 📋 Backlog in Commerce - Issues Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant