Skip to content

Commit ef27f94

Browse files
committed
MAGETWO-33342: Static files must not be cached by Varnish by default
1 parent a9a47c2 commit ef27f94

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ sub vcl_backend_response {
154154
# images, css and js are cacheable by default so we have to remove cookie also
155155
if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) {
156156
unset beresp.http.set-cookie;
157-
if (bereq.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") {
157+
if (bereq.url !~ "\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|html|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)(\?|$)") {
158158
set beresp.http.Pragma = "no-cache";
159159
set beresp.http.Expires = "-1";
160160
set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ sub vcl_backend_response {
155155
# images, css and js are cacheable by default so we have to remove cookie also
156156
if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) {
157157
unset beresp.http.set-cookie;
158-
if (bereq.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") {
158+
if (bereq.url !~ "\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|html|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)(\?|$)") {
159159
set beresp.http.Pragma = "no-cache";
160160
set beresp.http.Expires = "-1";
161161
set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";

0 commit comments

Comments
 (0)