Skip to content

Commit 8ac29f0

Browse files
committed
MAGETWO-54228: Varnish cache disabled on most html requests
- Added catalogsearch exclusion to varnish3.vcl - Cleaned up comments on varnish4.vcl
1 parent a48309c commit 8ac29f0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ sub vcl_recv {
4949
return (pass);
5050
}
5151

52-
# Bypass shopping cart and checkout requests
53-
if (req.url ~ "/checkout") {
52+
# Bypass shopping cart, checkout and search requests
53+
if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") {
5454
return (pass);
5555
}
5656

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,11 @@ sub vcl_backend_response {
137137
}
138138
}
139139

140-
#If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass
140+
# If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass
141141
if (beresp.ttl <= 0s ||
142142
beresp.http.Surrogate-control ~ "no-store" ||
143143
(!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) {
144-
/*
145-
* Mark as "Hit-For-Pass" for the next 2 minutes
146-
*/
144+
# Mark as Hit-For-Pass for the next 2 minutes
147145
set beresp.ttl = 120s;
148146
set beresp.uncacheable = true;
149147
}

0 commit comments

Comments
 (0)