Initial Cache-Control template

This commit is contained in:
Léo Colombaro 2022-11-03 01:34:32 +00:00
parent b46293cb35
commit 71568bffdb
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# ----------------------------------------------------------------------
# | Cache control |
# ----------------------------------------------------------------------
# TBD
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
map $sent_http_content_type $cache_control {
# (1)
default "private, must-revalidate";
# (2)
~*text/html "public, immutable";
~*text/css "public, immutable";
~*text/javascript "public, immutable";
~*xml "public, immutable";
~*application/pdf "public, immutable";
# (3)
~*audio/ "public, immutable";
~*image/ "public, immutable";
~*font/ "public, immutable";
~*video/ "public, immutable";
}
add_header Cache-Control $cache_control;