FastFPC icon indicating copy to clipboard operation
FastFPC copied to clipboard

Remove all marketing get parameters to minimize the cache objects

Open p24-max opened this issue 2 years ago • 4 comments

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, "[?|&]+$", "");

p24-max avatar Jun 09 '23 08:06 p24-max

good idea

YehorShytikovWB avatar Jun 14 '23 16:06 YehorShytikovWB

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 ?

Genaker avatar Aug 22 '23 07:08 Genaker

@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

p24-max avatar Aug 22 '23 08:08 p24-max

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: @.***>

Genaker avatar Aug 22 '23 23:08 Genaker