Set cache id prefix on installation#18641
Set cache id prefix on installation#18641magento-engcom-team merged 4 commits intomagento:2.3-developfrom schmengler:set-cache-id-prefix-on-install
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_prefixoption 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.phpatcache/frontend/{default,page_cache}/id_prefixContribution checklist (*)