-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Backport Magento 2.2 Set cache id prefix on installation #22439
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
Backport Magento 2.2 Set cache id prefix on installation #22439
Conversation
Hi @Ctucker9233. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ctucker9233 well, commit message could be better :)
Hi @orlangur, thank you for the review. |
✔️ QA Passed |
@@ -116,6 +122,60 @@ public function testCreateConfigWithRedisConfig() | |||
$this->assertEquals($expectedConfigData, $configData->getData()); | |||
} | |||
|
|||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orlangur I think this line is causing the Travis CL build to fail. Correct me if I'm wrong but this preserves the authorship so I don't think it can simply be removed.
@@ -36,6 +39,9 @@ protected function setUp() | |||
$this->configOptionsList = new CacheConfigOptionsList($this->validatorMock); | |||
} | |||
|
|||
/** | |||
* testGetOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmalevanec why need to add such useless annotations? Tests were ignored before, what caused such a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orlangur, I've moved this comment from 2.3-develop. But, ok I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmalevanec no need to remove, they must be not needed in 2.3-develop
as well.
45b6a3d
to
9d26084
Compare
Hi @Ctucker9233, thank you for your contribution! |
Original Pull Request #18641
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)
#15828: Multisite installation, default website slow
Manual testing scenarios (*)
Contribution checklist (*)