Skip to content

Commit f19eca6

Browse files
ENGCOM-4707: Remove all marketing get params on Varnish to minimize the cache objects (added facebook parameter) #22226
- Merge Pull Request #22226 from lfluvisotto/magento2:2.3-develop-varnish-remove-marketing-get-params - Merged commits: 1. c2d1f8f 2. b67192a
2 parents af6820c + b67192a commit f19eca6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/PageCache/etc/varnish4.vcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ sub vcl_recv {
9292
}
9393

9494
# Remove all marketing get parameters to minimize the cache objects
95-
if (req.url ~ "(\?|&)(gclid|cx|ie|cof|siteurl|zanpid|origin|mc_[a-z]+|utm_[a-z]+)=") {
96-
set req.url = regsuball(req.url, "(gclid|cx|ie|cof|siteurl|zanpid|origin|mc_[a-z]+|utm_[a-z]+)=[-_A-z0-9+()%.]+&?", "");
95+
if (req.url ~ "(\?|&)(gclid|cx|ie|cof|siteurl|zanpid|origin|fbclid|mc_[a-z]+|utm_[a-z]+|_bta_[a-z]+)=") {
96+
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+()%.]+&?", "");
9797
set req.url = regsub(req.url, "[?|&]+$", "");
9898
}
9999

app/code/Magento/PageCache/etc/varnish5.vcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ sub vcl_recv {
9393
}
9494

9595
# Remove all marketing get parameters to minimize the cache objects
96-
if (req.url ~ "(\?|&)(gclid|cx|ie|cof|siteurl|zanpid|origin|mc_[a-z]+|utm_[a-z]+)=") {
97-
set req.url = regsuball(req.url, "(gclid|cx|ie|cof|siteurl|zanpid|origin|mc_[a-z]+|utm_[a-z]+)=[-_A-z0-9+()%.]+&?", "");
96+
if (req.url ~ "(\?|&)(gclid|cx|ie|cof|siteurl|zanpid|origin|fbclid|mc_[a-z]+|utm_[a-z]+|_bta_[a-z]+)=") {
97+
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+()%.]+&?", "");
9898
set req.url = regsub(req.url, "[?|&]+$", "");
9999
}
100100

0 commit comments

Comments
 (0)