diff --git a/provisioning/production/files/nginx/production.conf b/provisioning/production/files/nginx/production.conf index 984960d5..a3e0837f 100644 --- a/provisioning/production/files/nginx/production.conf +++ b/provisioning/production/files/nginx/production.conf @@ -1,7 +1,13 @@ map $sent_http_content_type $expires { "text/html" epoch; "text/html; charset=utf-8" epoch; - default off; + default 1y; +} + +map $sent_http_content_type $cache_control { + "text/html" "no-cache, no-store, must-revalidate"; + "text/html; charset=utf-8" "no-cache, no-store, must-revalidate"; + default "public, max-age=31536000, immutable"; } server { @@ -22,6 +28,7 @@ server { location / { expires $expires; + add_header Cache-Control $cache_control; proxy_redirect off; proxy_set_header Host $host; diff --git a/provisioning/staging/files/nginx/staging.conf b/provisioning/staging/files/nginx/staging.conf index e3c27a90..7ece4538 100644 --- a/provisioning/staging/files/nginx/staging.conf +++ b/provisioning/staging/files/nginx/staging.conf @@ -1,7 +1,13 @@ map $sent_http_content_type $expires { "text/html" epoch; "text/html; charset=utf-8" epoch; - default off; + default 1y; +} + +map $sent_http_content_type $cache_control { + "text/html" "no-cache, no-store, must-revalidate"; + "text/html; charset=utf-8" "no-cache, no-store, must-revalidate"; + default "public, max-age=31536000, immutable"; } server { @@ -16,6 +22,7 @@ server { location / { expires $expires; + add_header Cache-Control $cache_control; proxy_redirect off; proxy_set_header Host $host;