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

Remove all marketing get parameters to minimize the cache objects #1

Open
p24-max opened this issue Jun 9, 2023 · 4 comments
Open

Comments

@p24-max
Copy link

p24-max commented Jun 9, 2023

Marketing query parameter like gclid should not be respected in cache-key.

Varnish equivalent:

set req.url = regsuball(req.url, "(gclid|cx|ie|cof|siteurl|zanpid|origin|fbclid|mc_[a-z]+|utm_[a-z]+|_bta_[a-z]+)=[-_A-z0-9+()%.]+&?", "");
set req.url = regsub(req.url, "[?|&]+$", "");
@YehorShytikovWB
Copy link

good idea

@Genaker
Copy link
Owner

Genaker commented Aug 22, 2023

Marketing query parameter like gclid should not be respected in cache-key.

Varnish equivalent:


set req.url = regsuball(req.url, "(gclid|cx|ie|cof|siteurl|zanpid|origin|fbclid|mc_[a-z]+|utm_[a-z]+|_bta_[a-z]+)=[-_A-z0-9+()%.]+&?", "");

set req.url = regsub(req.url, "[?|&]+$", "");

Could you please translate what this regsuball and regsub does ?

@p24-max
Copy link
Author

p24-max commented Aug 22, 2023

@Genaker I have not invented these two lines, its copied from magento varnish config file.
Basically, line 1 removes tracking query parameters including their corresponding value
Line 2 removes ? or & from the end of the URL

@Genaker
Copy link
Owner

Genaker commented Aug 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants