Skip to content

Commit 5ec0996

Browse files
committed
MAGETWO-33342: Static files must not be cached by Varnish by default
1 parent 938313e commit 5ec0996

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ sub vcl_recv {
9696
set req.url = regsuball(req.url,"\?gclid=[^&]+&","?"); # strips when QS = "?gclid=AAA&foo=bar"
9797
set req.url = regsuball(req.url,"&gclid=[^&]+",""); # strips when QS = "?foo=bar&gclid=AAA" or QS = "?foo=bar&gclid=AAA&bar=baz"
9898

99-
# static files are always cacheable. remove SSL flag and cookie
100-
if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|html|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") {
101-
unset req.http.Https;
102-
unset req.http./* {{ ssl_offloaded_header }} */;
103-
unset req.http.Cookie;
104-
}
105-
10699
return (hash);
107100
}
108101

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ sub vcl_recv {
9797
set req.url = regsuball(req.url,"\?gclid=[^&]+&","?"); # strips when QS = "?gclid=AAA&foo=bar"
9898
set req.url = regsuball(req.url,"&gclid=[^&]+",""); # strips when QS = "?foo=bar&gclid=AAA" or QS = "?foo=bar&gclid=AAA&bar=baz"
9999

100-
# static files are always cacheable. remove SSL flag and cookie
101-
if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|html|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") {
102-
unset req.http.Https;
103-
unset req.http./* {{ ssl_offloaded_header }} */;
104-
unset req.http.Cookie;
105-
}
106-
107100
return (hash);
108101
}
109102

0 commit comments

Comments
 (0)