Skip to content

Commit a48309c

Browse files
committed
MAGETWO-54228: Varnish cache disabled on most html requests
- fixed indentation and comments on vcl
1 parent 1865c14 commit a48309c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sub vcl_recv {
4141
return (pass);
4242
}
4343

44-
# Bypass shopping cart and checkout and search requests
44+
# Bypass shopping cart, checkout and search requests
4545
if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") {
4646
return (pass);
4747
}
@@ -137,17 +137,17 @@ sub vcl_backend_response {
137137
}
138138
}
139139

140-
#If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass
141-
if (beresp.ttl <= 0s ||
142-
beresp.http.Surrogate-control ~ "no-store" ||
143-
(!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) {
144-
/*
145-
* Mark as "Hit-For-Pass" for the next 2 minutes
146-
*/
147-
set beresp.ttl = 120s;
148-
set beresp.uncacheable = true;
149-
}
150-
return (deliver);
140+
#If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass
141+
if (beresp.ttl <= 0s ||
142+
beresp.http.Surrogate-control ~ "no-store" ||
143+
(!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) {
144+
/*
145+
* Mark as "Hit-For-Pass" for the next 2 minutes
146+
*/
147+
set beresp.ttl = 120s;
148+
set beresp.uncacheable = true;
149+
}
150+
return (deliver);
151151
}
152152

153153
sub vcl_deliver {

0 commit comments

Comments
 (0)