Skip to content

Backport 2.2 Set cache id prefix on installation #22329

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

Closed
wants to merge 14 commits into from
Closed

Backport 2.2 Set cache id prefix on installation #22329

wants to merge 14 commits into from

Conversation

Ctucker9233
Copy link

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 (*)

  1. Install Magento via CLI or Web Wizard
  2. There should be new options "cache-id-prefix" and "page-cache-id-prefix"
  3. The value is saved in env.php at cache/frontend/{default,page_cache}/id_prefix

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2019

Hi @Ctucker9233. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.2-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@m2-assistant
Copy link

m2-assistant bot commented Apr 14, 2019

Hi @Ctucker9233, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@Ctucker9233 Ctucker9233 deleted the 2.2-develop branch April 14, 2019 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants