Genaker / FastFPC

Magento 2 improved FPC and Varnish replacement was used for Magento SaaS solution when you need high performace and scaling. No more outdated Adobes official Varnish approach is requred
53 stars 11 forks source link

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

Open p24-max opened 1 year ago

p24-max commented 1 year ago

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 commented 1 year ago

good idea

Genaker commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

Oh nice. This one is better explaining. Also get parameters must be ordered.

On Tue, Aug 22, 2023 at 1:19 AM p24-max @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/Genaker/FastFPC/issues/1#issuecomment-1687706182, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGJNZT4E4N3A6YL565APODXWRTSLANCNFSM6AAAAAAZAKVFYE . You are receiving this because you were mentioned.Message ID: @.***>