Skip to content

Remove all marketing get parameters to minimize the cache using built-in FPC #39099

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

Merged

Conversation

rogerdz
Copy link
Contributor

@rogerdz rogerdz commented Aug 23, 2024

Description (*)

Same logic when use varnish (https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/PageCache/etc/varnish7.vcl#L84) but for build-in fpc

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Clear cache: bin/magento cache:clean
  2. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?test=111&utm_source=123&gclid=abc' | grep -i X-Magento-Cache-Debug, it return x-magento-cache-debug: MISS => correct
  3. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?test=111&utm_source=123&gclid=abc' | grep -i X-Magento-Cache-Debug, it return x-magento-cache-debug: HIT => correct
  4. Run command: curl -I --location-trusted 'https://magento2.test/gear/bags.html?test=111' | grep -i X-Magento-Cache-Debug => it should return x-magento-cache-debug: HIT

Questions or comments

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Remove all marketing get parameters to minimize the cache #39266: Remove all marketing get parameters to minimize the cache

Copy link

m2-assistant bot commented Aug 23, 2024

Hi @rogerdz. Thank you for your contribution!
Here are some useful tips on 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@rogerdz
Copy link
Contributor Author

rogerdz commented Aug 23, 2024

@magento run all tests

@rogerdz
Copy link
Contributor Author

rogerdz commented Aug 23, 2024

@magento run all tests

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Aug 27, 2024
@sprankhub
Copy link
Member

Nice. Maybe you want to update the parameters based on https://github.com/magento/magento2/pull/39188/files#diff-40e00b332f8dd95fbf48a312b9b8cfeee0d4e70bd7528c0e794c84c9e00c113fR85.

@Priyakshic Priyakshic added the Project: Community Picked PRs upvoted by the community label Oct 15, 2024
@engcom-Hotel engcom-Hotel self-requested a review October 16, 2024 06:43
@engcom-Hotel
Copy link
Contributor

@magento create issue

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run Database Compare, Functional Tests B2B, Functional Tests CE

@sprankhub
Copy link
Member

Please mind that #39188 is also community-picked and is more complete. Specifically, it includes the changes from this PR. Hence, I think the solution from #39188 should be merged.

@hostep
Copy link
Contributor

hostep commented Oct 16, 2024

@sprankhub, I think you got confused and meant to comment on #35228
This PR here adds the extra parameters to the non-Varnish based FPC solution from Magento. But I believe the list should be updated with the list from #39188 so they match 100%.

Ideally we should have one place where the entire list is defined and can be used both by the Varnish VCL file generator and the non-Varnish based FPC solution. Maybe using a backoffice configuration field? We have a new request for that since today BTW: #39268 (even though the example given there is a very bad idea)

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I got right, you’re removing cache parameters on Magento (php) side.
for that purpose, Varnish does way better job, since it works way better and uses resources more efficiently.
I don’t see how someone would use built in full page cache in production, so I don’t think we should update it

Example use case:
you added a new service, let’s say Klaviyo, that adds a dynamic value for each client.
Marketing team has sent an email to all subscribers and they starting clicking on link that goes to a single product page.
What we have right now is - the dynamic get parameter will be removed by Varnish, and after the first request - it will put the result in cache. all next requests will not get to Magento/php - so they will be delivered to clients waaaay faster and won’t create load to web servers, database and redis.
if we accept your changes - this would mean that this dynamic get parameter will be removed on php side, which will result in additional slower responses, additional load to web servers, database and redis.

Having all that in mind, I don’t think we can accept this pull request, but instead, we should actualize the list in Varnish config.

Please correct me if I’m wrong

@ihor-sviziev
Copy link
Contributor

Sorry, looks like I got confused a bit.
But still, it’s not clear if it worth fixing built in full page cache. Does anyone using it in production? If no - why would we support the list in 2 places?

@ihor-sviziev ihor-sviziev changed the title Remove all marketing get parameters to minimize the cache Remove all marketing get parameters to minimize the cache using built-in FPC Nov 19, 2024
@ihor-sviziev ihor-sviziev requested a review from Copilot November 19, 2024 21:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (4)
  • app/code/Magento/PageCache/Model/App/Request/Http/IdentifierForSave.php: Language not supported
  • app/code/Magento/PageCache/Test/Unit/Model/App/Request/Http/IdentifierForSaveTest.php: Language not supported
  • lib/internal/Magento/Framework/App/PageCache/Identifier.php: Language not supported
  • lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php: Language not supported

@engcom-Hotel
Copy link
Contributor

@magento run Functional Tests CE, Unit Tests

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @rogerdz @engcom-Dash,

The changes looks good to me. But please address the failed automated tests.

Thanks

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Bravo
Copy link
Contributor

Hi @rogerdz,

Thanks for your Contribution!!.

We have verified the issue in Latest 2.4-develop Magento Instance and the issue is not reproducible.Kindly refer the screenshots.

Screenshot 2024-11-22 at 12 16 46

The last request also showing Hit.Could you please let us know if we are missing anything.

Thanks.

@ihor-sviziev
Copy link
Contributor

@engcom-Bravo, are you testing on built-in FPC without Varnish?

@engcom-Bravo
Copy link
Contributor

Hi @ihor-sviziev,

Thanks for your update!!.

We have tested with Full Page Cache(built in) without varnish.

Screenshot 2024-11-22 at 18 19 24

Thanks.

@rogerdz
Copy link
Contributor Author

rogerdz commented Nov 22, 2024

@engcom-Bravo last request must call url without marketing parameter

@engcom-Bravo
Copy link
Contributor

@magento run all tests

@engcom-Bravo
Copy link
Contributor

Hi @rogerdz,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

Before: ✖️ 

Screenshot 2024-11-25 at 09 45 49

After: ✔️

Screenshot 2024-11-25 at 09 56 33

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

@engcom-Dash
Copy link
Contributor

@magento run Integration Tests, Functional Tests CE, Functional Tests B2B

1 similar comment
@engcom-Dash
Copy link
Contributor

@magento run Integration Tests, Functional Tests CE, Functional Tests B2B

@engcom-Dash
Copy link
Contributor

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 8f36bc3 into magento:2.4-develop Dec 21, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Project: Community Picked PRs upvoted by the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Remove all marketing get parameters to minimize the cache