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

Add MAGE_RUN_TYPE+MAGE_RUN_CODE to FPC identifier #18624

Merged
merged 3 commits into from
Aug 9, 2019

Conversation

amenk
Copy link
Contributor

@amenk amenk commented Oct 15, 2018

Description

Currently Magento 2.2.6 full page cache does not work correctly, when using SetEnv or similar techniques on unchanged URLs

So the MAGE_RUN_TYPE and MAGE_RUN_CODE should be added to the FPC identifier to allow for such use cases.

A common case is Magento 2 behind a reverse NGINX proxy.

Manual testing scenarios

Steps to reproduce, without proxy setup:

  1. In pub/.htaccess set

SetEnv MAGE_RUN_TYPE store SetEnv MAGE_RUN_CODE italy

  1. Now open Frontend

  2. Now set

SetEnv MAGE_RUN_TYPE store SetEnv MAGE_RUN_CODE english

  1. Now Open frontend, same URL

-> Italian version is displayed

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)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Oct 15, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @amenk. 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 $VERSION instance - deploy vanilla Magento instance

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

@miguelbalparda
Copy link
Contributor

Hi @amenk, can you please check the failing tests?

@amenk
Copy link
Contributor Author

amenk commented Oct 16, 2018

@miguelbalparda

Okay I will..probably I should also add a new test as well.
Is the code fine, or is the approach wrong?

I was afraid using mage store constants in framework but it seems to happen also in other places.

@miguelbalparda
Copy link
Contributor

I think the approach is correct, will double check internally and get back to you if anything changes.

@miguelbalparda
Copy link
Contributor

Anything on this one @amenk? It's been a while, please let me know if you are still working on this PR.

@amenk
Copy link
Contributor Author

amenk commented Nov 19, 2018

I think the approach is correct, will double check internally and get back to you if anything changes.

@miguelbalparda I was waiting for your response on this ...

and I am having a lack of time, but will try my best to get that PR through, if you tell me, the approach is correct.

@miguelbalparda
Copy link
Contributor

Closing for lack of feedback, feel free to reopen if you have time to keep working on this,

@amenk
Copy link
Contributor Author

amenk commented Dec 18, 2018

@miguelbalparda

will double check internally and get back to you if anything changes.

Did you already double check?

@amenk
Copy link
Contributor Author

amenk commented Dec 31, 2018

@miguelbalparda your feedback would motivate me :-)

I am still not sure if my approach has scoping issues ...

@amenk
Copy link
Contributor Author

amenk commented Mar 8, 2019

Will work on this today.

@amenk amenk reopened this Mar 8, 2019
@ghost ghost unassigned miguelbalparda Mar 8, 2019
@amenk amenk force-pushed the amenk-patch-2 branch 2 times, most recently from 7911630 to c21c44e Compare March 8, 2019 10:54
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 8, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 8, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 8, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 8, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 9, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 9, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 9, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 9, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 9, 2019
amenk added a commit to iMi-digital/magento2 that referenced this pull request Mar 9, 2019
@sivaschenko
Copy link
Member

@amenk thanks for your patience, this pull request is under discussion

@sivaschenko
Copy link
Member

@magento run all tests

amenk and others added 3 commits June 22, 2019 16:13
Currently Magento 2.2.6 full page cache does not work correctly, when using SetEnv or similar techniques on unchanged URLs
So the MAGE_RUN_TYPE and MAGE_RUN_CODE should be added to the FPC identifier to allow for such use cases.
A common case is Magento 2 behind a reverse NGINX proxy.

This commit adds the MAGE_RUN_TYPE and MAGE_RUN_CODE to the cache idenfier, if present.
It is done inline with the design exceptions. Also the existing cache idenfier is change a little to accomondate
the new information properly.

Of course this will invalidate existing page caches with design exceptions, but as for any deploy the page
cache usually is invalidated, this is not a problem.
@ghost
Copy link

ghost commented Jun 22, 2019

@amenk unfortunately, only members of the maintainers team are allowed to unassign developers from the pull request

@amenk
Copy link
Contributor Author

amenk commented Jun 22, 2019

@amenk unfortunately, only members of the maintainers team are allowed to unassign developers from the pull request

I did not try to unassign anybody :)

@amenk
Copy link
Contributor Author

amenk commented Jun 22, 2019

all checks are green now

@ihor-sviziev ihor-sviziev requested a review from sivaschenko July 19, 2019 06:09
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-4467 has been created to process this Pull Request
✳️ @sivaschenko, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Delta engcom-Delta self-assigned this Jul 19, 2019
@sivaschenko sivaschenko added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Jul 21, 2019
@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Aug 9, 2019

Hi @amenk, 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.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.4 milestone Aug 9, 2019
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this pull request Aug 9, 2019
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.

10 participants