From b2ae31cad10709614620acd3633c88c8ae738fb4 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 4 May 2023 10:45:55 +0100 Subject: [PATCH] Move cache ttl to max-age rather than expires --- conf/nginx.conf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d64739c..f251c43 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -39,8 +39,7 @@ http { gzip_static on; brotli_static on; error_page 404 /404.html; - expires 2d; - add_header Cache-Control "public, no-transform"; + add_header Cache-Control "public, no-transform, max-age=1209600"; } location /api/ { @@ -48,8 +47,7 @@ http { proxy_cache_key $scheme://$host$uri$is_args$query_string; proxy_ignore_headers Cache-Control; proxy_cache_valid 200 2m; # Evaluate whether 2m or 1m is more appropriate - expires 2m; - add_header Cache-Control "private, no-transform"; + add_header Cache-Control "private, no-transform, max-age=120"; } location /api/v1/list/ { @@ -57,8 +55,7 @@ http { proxy_cache_key $scheme://$host$uri$is_args$query_string; proxy_ignore_headers Cache-Control; proxy_cache_valid 200 10080m; - expires 7d; - add_header Cache-Control "public, no-transform"; + add_header Cache-Control "public, no-transform, max-age=604800"; } } }