Skip to content

Commit

Permalink
Replace location block add_header directives with expires directives
Browse files Browse the repository at this point in the history
Fixes #193
  • Loading branch information
mattrubin authored and LeoColomb committed Nov 23, 2018
1 parent c5c6602 commit 135d093
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion h5bp/location/cross-domain-fonts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
# And https://github.com/h5bp/server-configs/issues/85
# And https://github.com/h5bp/server-configs/issues/86
access_log off;
add_header Cache-Control "max-age=2592000";
expires 1M;
}
12 changes: 6 additions & 6 deletions h5bp/location/expires.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@

# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
add_header Cache-Control "max-age=0";
expires 0;
}

# Feed
location ~* \.(?:rss|atom)$ {
add_header Cache-Control "max-age=3600";
expires 1h;
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
access_log off;
add_header Cache-Control "max-age=2592000";
expires 1M;
}

# Media: svgz files are already compressed.
location ~* \.svgz$ {
access_log off;
gzip off;
add_header Cache-Control "max-age=2592000";
expires 1M;
}

# CSS and Javascript
location ~* \.(?:css|js)$ {
add_header Cache-Control "max-age=31536000";
expires 1y;
access_log off;
}

# WebFonts
# If you are NOT using cross-domain-fonts.conf, uncomment the following directive
# location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
# add_header Cache-Control "max-age=2592000";
# expires 1M;
# access_log off;
# }

0 comments on commit 135d093

Please sign in to comment.