Skip to content

Commit 4ee5074

Browse files
author
Igor Melnikov
committed
MAGETWO-44448: Checkout requests become bottleneck on Varnish 4 due to grace mode
Adding regular expression to allow Varnish bypass shopping cart and checkout requests
1 parent 80c5e2b commit 4ee5074

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ sub vcl_recv {
4646
if (req.request != "GET" && req.request != "HEAD") {
4747
return (pass);
4848
}
49-
49+
50+
# Bypass shopping cart and checkout requests
51+
if (req.url ~ "/checkout") {
52+
return (pass);
53+
}
54+
5055
# normalize url in case of leading HTTP scheme and domain
5156
set req.url = regsub(req.url, "^http[s]?://", "");
5257

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ sub vcl_recv {
4040
return (pass);
4141
}
4242

43+
# Bypass shopping cart and checkout requests
44+
if (req.url ~ "/checkout") {
45+
return (pass);
46+
}
47+
4348
# normalize url in case of leading HTTP scheme and domain
4449
set req.url = regsub(req.url, "^http[s]?://", "");
4550

0 commit comments

Comments
 (0)