Initial Cache-Control template
This commit is contained in:
parent
b46293cb35
commit
71568bffdb
|
@ -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;
|
Loading…
Reference in New Issue