diff --git a/h5bp/web_performance/cache-control.conf b/h5bp/web_performance/cache-control.conf new file mode 100644 index 0000000..1864fe8 --- /dev/null +++ b/h5bp/web_performance/cache-control.conf @@ -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;