Skip to content

Commit 78a7eef

Browse files
committed
Fix Cache-Control headers overriding security headers
1 parent 3f52323 commit 78a7eef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

global/server/static-files.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
# Don't cache appcache, document html and data.
22
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
3-
add_header Cache-Control "max-age=0";
3+
expires 0;
44
}
55

66
# Cache RSS and Atom feeds.
77
location ~* \.(?:rss|atom)$ {
8-
add_header Cache-Control "max-age=3600";
8+
expires 1h;
99
}
1010

1111
# Caches images, icons, video, audio, HTC, etc.
1212
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
13-
add_header Cache-Control "max-age=31536000";
13+
expires 1y;
1414
access_log off;
1515
}
1616

1717
# Cache svgz files, but don't compress them.
1818
location ~* \.svgz$ {
19-
add_header Cache-Control "max-age=31536000";
19+
expires 1y;
2020
access_log off;
2121
gzip off;
2222
}
2323

2424
# Cache CSS and JavaScript.
2525
location ~* \.(?:css|js)$ {
26-
add_header Cache-Control "max-age=31536000";
26+
expires 1y;
2727
access_log off;
2828
}
2929

3030
# Cache WebFonts.
3131
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
32-
add_header Cache-Control "max-age=31536000";
32+
expires 1y;
3333
access_log off;
3434
}
3535

0 commit comments

Comments
 (0)