2019-02-10 20:46:58 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# | Cache expiration |
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2020-04-14 11:53:56 +02:00
|
|
|
# Serve resources with a far-future expiration date.
|
2019-02-10 20:46:58 +01:00
|
|
|
#
|
2019-05-15 18:38:05 +02:00
|
|
|
# (!) If you don't control versioning with filename-based cache busting, you
|
|
|
|
# should consider lowering the cache times to something like one week.
|
2019-02-10 20:46:58 +01:00
|
|
|
#
|
|
|
|
# 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 {
|
2021-11-14 22:18:27 +01:00
|
|
|
default 1y;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
2019-05-15 02:30:40 +02:00
|
|
|
# No content
|
|
|
|
"" off;
|
|
|
|
|
2019-02-10 20:46:58 +01:00
|
|
|
# CSS
|
2019-03-09 02:34:15 +01:00
|
|
|
~*text/css 1y;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Data interchange
|
2019-03-09 13:45:33 +01:00
|
|
|
~*application/atom\+xml 1h;
|
|
|
|
~*application/rdf\+xml 1h;
|
|
|
|
~*application/rss\+xml 1h;
|
2019-03-09 02:34:15 +01:00
|
|
|
|
2022-09-09 08:18:52 +02:00
|
|
|
~*application/json off;
|
|
|
|
~*application/ld\+json off;
|
|
|
|
~*application/schema\+json off;
|
|
|
|
~*application/geo\+json off;
|
|
|
|
~*application/xml off;
|
|
|
|
~*text/calendar off;
|
|
|
|
~*text/xml off;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Favicon (cannot be renamed!) and cursor images
|
2019-03-09 02:34:15 +01:00
|
|
|
~*image/vnd.microsoft.icon 1w;
|
|
|
|
~*image/x-icon 1w;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# HTML
|
2022-09-09 08:18:52 +02:00
|
|
|
~*text/html off;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# JavaScript
|
2019-03-09 02:34:15 +01:00
|
|
|
~*application/javascript 1y;
|
|
|
|
~*application/x-javascript 1y;
|
|
|
|
~*text/javascript 1y;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Manifest files
|
2019-03-09 13:45:33 +01:00
|
|
|
~*application/manifest\+json 1w;
|
2022-09-09 08:18:52 +02:00
|
|
|
~*application/x-web-app-manifest\+json off;
|
|
|
|
~*text/cache-manifest off;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Markdown
|
2022-09-09 08:18:52 +02:00
|
|
|
~*text/markdown off;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Media files
|
2021-11-05 16:56:26 +01:00
|
|
|
~*audio/ 1y;
|
|
|
|
~*image/ 1y;
|
|
|
|
~*video/ 1y;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# WebAssembly
|
2019-03-09 02:34:15 +01:00
|
|
|
~*application/wasm 1y;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Web fonts
|
2021-11-05 16:56:26 +01:00
|
|
|
~*font/ 1y;
|
|
|
|
~*application/vnd.ms-fontobject 1y;
|
|
|
|
~*application/x-font-ttf 1y;
|
|
|
|
~*application/x-font-woff 1y;
|
|
|
|
~*application/font-woff 1y;
|
|
|
|
~*application/font-woff2 1y;
|
2019-02-10 20:46:58 +01:00
|
|
|
|
|
|
|
# Other
|
2019-03-09 02:34:15 +01:00
|
|
|
~*text/x-cross-domain-policy 1w;
|
2019-02-10 20:46:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
expires $expires;
|