-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Set cache id prefix on installation #18641
Set cache id prefix on installation #18641
Conversation
Hi @schmengler. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
To be discussed: what if the behavior to have a cache prefix based on installation dir is desired? This can be the case if a cache for an old release should coexist with a cache for a new release which gets pre-warmed before switching |
Hey @schmengler Thank you for the contribution. It is really a good improvement. The case with pre-warming also fits it since we may decide whether it is generated or set by a user. |
Hey @schmengler GitHub show that you didn't sign up the CLA. Could you do that following the link? |
@slavvka Oh, apparently there's a new CLA that I did not sign yet, did it now! |
- fixed docblock
- fixed docblock
- fixed static test
Hi @schmengler. Thank you for your contribution. |
Description (*)
The undocumented
id_prefix
option for the cache frontend is used to prefix cache keys. If it is not set, Magento uses the first 12 bits of the md5 hash of the absolute path to Magentos app/etc directory. But if this is not exactly the same on all web servers, cache invalidation does not work.Source: https://github.com/magento/magento2/blob/2.3-develop/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php#L121-L130
To prevent this issue, the value shall be set on installation, so that the fall back on the fly does not happen anymore. Optionally, the value can be specified explicitly.
Fixed Issues (if relevant)
Manual testing scenarios (*)
env.php
atcache/frontend/{default,page_cache}/id_prefix
Contribution checklist (*)