Skip to content

Commit 61fee9b

Browse files
committed
MAGETWO-71434: Generated pages with "html" extension are not cached by Varnish
1 parent fe6fb3b commit 61fee9b

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,8 @@ sub vcl_backend_response {
157157
}
158158

159159
# validate if we need to cache it and prevent from setting cookie
160-
# images, css and js are cacheable by default so we have to remove cookie also
161160
if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) {
162161
unset beresp.http.set-cookie;
163-
if (bereq.url !~ "\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|tiff|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?|$)") {
164-
set beresp.http.Pragma = "no-cache";
165-
set beresp.http.Expires = "-1";
166-
set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";
167-
}
168162
}
169163

170164
# If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,8 @@ sub vcl_backend_response {
158158
}
159159

160160
# validate if we need to cache it and prevent from setting cookie
161-
# images, css and js are cacheable by default so we have to remove cookie also
162161
if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) {
163162
unset beresp.http.set-cookie;
164-
if (bereq.url !~ "\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|tiff|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?|$)") {
165-
set beresp.http.Pragma = "no-cache";
166-
set beresp.http.Expires = "-1";
167-
set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";
168-
}
169163
}
170164

171165
# If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass

0 commit comments

Comments
 (0)