magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.39k stars 9.29k forks source link

The Varnish configs do not strip Klaviyo marketing parameter #35227

Open Gelmo opened 2 years ago

Gelmo commented 2 years ago

Preconditions (*)

  1. Any Magento version that includes a suggested Varnish VCL config.
  2. Using Varnish along with a VCL that is included with Magento.
  3. Usage of Klaviyo's marketing email services/modules.

Steps to reproduce (*)

  1. Use a VCL that is included with Magento.
  2. Send a marketing email via Klaviyo.
  3. Watch varnishlog.
  4. Visit the site using a link that is included in a Klaviyo-generated email.
  5. Visit the site using a similar link that does not include the _kx query parameter.
  6. Compare the results shown by varnishlog.

Expected result (*)

  1. The _kx parameter should be stripped, ensuring that visitors using links with the _kx parameter are served the cached version of the requested page.

Actual result (*)

  1. Varnish does not strip the parameter, and since the value is unique per visitor, those requests will not match any hashes in Varnish's cache.
  2. This also results in additional PHP load due to the request needing to be processed by Magento.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @Gelmo. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

Gelmo commented 2 years ago

@magento I am working on this

m2-assistant[bot] commented 2 years ago

Hi @Gelmo! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

Gelmo commented 2 years ago

@magento add to contributors team

m2-assistant[bot] commented 2 years ago

Hi @Gelmo! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

Gelmo commented 2 years ago

@magento I am working on this

m2-assistant[bot] commented 1 year ago

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


engcom-Dash commented 1 year ago

Hi @Gelmo ,

We are trying to reproduce the issue in 2.4-develop instance but we are not able to reproduce. Steps We followed: 1.Install mAgento 2.Done Varnish Setup Configuration 3.Install Klaviyos Module 4.Integrate with magento from klaviyos 5.we are not able to integrate the module

Screenshots:

Screenshot 2022-11-04 at 4 34 16 PM

Still we are working in this module to reproduce the issue...we will reproduce the issue ASAP.

Let us know if we missing anything!!! Thanks!!!

vasileuskidzmitry commented 8 months ago

@engcom-Dash Hello! How to move this issue from the ground? Can it be assigned to me to complete the rest of the required steps?

vasileuskidzmitry commented 8 months ago

@magento I'm working on this

m2-assistant[bot] commented 8 months ago

Hi @vasileuskidzmitry! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

vasileuskidzmitry commented 8 months ago

@magento add to contributors team

m2-assistant[bot] commented 8 months ago

Hi @vasileuskidzmitry! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

vasileuskidzmitry commented 8 months ago

@magento I'm working on this

vasileuskidzmitry commented 8 months ago

I'm unable to edit the original comments to update steps so I will add them here.

*Steps to reproduce ()**

  1. Use a VCL that is included with Magento.
  2. Read this article as confirmation that _kx parameter belongs to Klaviyo marketing campaigns - https://help.klaviyo.com/hc/en-us/articles/115005076767.
  3. Switch Magento/Adobe Commerce to developer mode so the X-Magento-Cache-Debug header is included in the response.
  4. Visit any page (for instance the Home one) twice. Check that X-Magento-Cache-Debug contains HIT value to confirm that the page is cached by Varnish.
  5. Now add _kx parameter with some random unique value (Ex. https://yourdomain/?_kx=1) to the URL and visit it.

Expected Result

  1. When you visit the URL form point 5, you see HIT value in the X-Magento-Cache-Debug, because _kx is a marketing parameter that should be omitted.
  2. Every time you change _kx to some new value, you see HIT anyway.

Actual Result

  1. You see MISS in that header.
  2. Every time you change _kx to some new value, you see MISS anyway. A new cache entity is created in Varnish on every such request.
vasileuskidzmitry commented 8 months ago

cc @engcom-Dash

vasileuskidzmitry commented 7 months ago

Added new PR

vasileuskidzmitry commented 7 months ago

cc @engcom-Bravo

ihor-sviziev commented 6 months ago

I updated priority to p2, to make it similar to https://github.com/magento/magento2/pull/38302#event-11314093429

vasileuskidzmitry commented 6 months ago

@ihor-sviziev Here is one another marketing system https://www.northbeam.io/ that uses its own marketing parameters (starting with "nb_"). Should I create a separate issue/PR for this or it could be done here or in #38302 ?

ihor-sviziev commented 6 months ago

@vasileuskidzmitry I don't mind about any of these options.