-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from location directives to maps based on MIME-types
* Expire * X-XSS-Protection * X-Frame-Options * X-UA-Compatible * Content-Security-Policy * Access-Control-Allow-Origin
- Loading branch information
Showing
11 changed files
with
148 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# ---------------------------------------------------------------------- | ||
# | Cache expiration | | ||
# ---------------------------------------------------------------------- | ||
|
||
# Serve resources with far-future expiration date. | ||
# | ||
# (!) If you don't control versioning with filename-based | ||
# cache busting, you should consider lowering the cache times | ||
# to something like one week. | ||
# | ||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control | ||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires | ||
# https://nginx.org/en/docs/http/ngx_http_headers_module.html#expires | ||
|
||
map $sent_http_content_type $expires { | ||
default 1M; | ||
|
||
# CSS | ||
text/css 1y; | ||
|
||
# Data interchange | ||
application/atom+xml 1h; | ||
application/rdf+xml 1h; | ||
application/rss+xml 1h; | ||
|
||
application/json 0; | ||
application/ld+json 0; | ||
application/schema+json 0; | ||
application/geo+json 0; | ||
application/xml 0; | ||
text/calendar 0; | ||
text/xml 0; | ||
|
||
# Favicon (cannot be renamed!) and cursor images | ||
image/vnd.microsoft.icon 1w; | ||
image/x-icon 1w; | ||
|
||
# HTML | ||
text/html 0; | ||
|
||
# JavaScript | ||
application/javascript 1y; | ||
application/x-javascript 1y; | ||
text/javascript 1y; | ||
|
||
# Manifest files | ||
application/manifest+json 1w; | ||
application/x-web-app-manifest+json 0; | ||
text/cache-manifest 0; | ||
|
||
|
||
# Markdown | ||
text/markdown 0; | ||
|
||
# Media files | ||
audio/ogg 1M; | ||
image/bmp 1M; | ||
image/gif 1M; | ||
image/jpeg 1M; | ||
image/png 1M; | ||
image/svg+xml 1M; | ||
image/webp 1M; | ||
video/mp4 1M; | ||
video/ogg 1M; | ||
video/webm 1M; | ||
|
||
# WebAssembly | ||
application/wasm 1y; | ||
|
||
# Web fonts | ||
font/collection 1M; | ||
application/vnd.ms-fontobject 1M; | ||
font/eot 1M; | ||
font/opentype 1M; | ||
font/otf 1M; | ||
application/x-font-ttf 1M; | ||
font/ttf 1M; | ||
application/font-woff 1M; | ||
application/x-font-woff 1M; | ||
font/woff 1M; | ||
application/font-woff2 1M; | ||
font/woff2 1M; | ||
|
||
# Other | ||
text/x-cross-domain-policy 1w; | ||
} | ||
|
||
expires $expires; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters