From 286b50b09b0f6d84da25026e4fa45e27075cb9c0 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Fri, 10 Jul 2026 22:19:25 -0400 Subject: [PATCH] Raise default response-cache TTL to 48h Bump proxy_cache_valid from 10m to 48h and match proxy_cache_path `inactive` (must be >= the TTL or entries evict before expiring). Co-Authored-By: Claude Opus 4.8 --- ops/nginx_conf/nginx.conf | 7 ++++--- ops/nginx_conf/proxy.conf | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ops/nginx_conf/nginx.conf b/ops/nginx_conf/nginx.conf index e51ae66..52b2e00 100644 --- a/ops/nginx_conf/nginx.conf +++ b/ops/nginx_conf/nginx.conf @@ -22,10 +22,11 @@ http { lua_shared_dict ratelimit 10m; # Per-host response cache. Enabled per request via $skip_cache in proxy.conf; - # 10m is the default TTL when the upstream doesn't send its own Cache-Control. + # 48h is the default TTL when the upstream doesn't send its own Cache-Control. + # `inactive` must be >= the TTL or entries get evicted before they expire. proxy_cache_path /var/cache/nginx/proxy levels=1:2 keys_zone=proxycache:100m - max_size=2g inactive=60m use_temp_path=off; - proxy_cache_valid 200 301 302 10m; + max_size=2g inactive=48h use_temp_path=off; + proxy_cache_valid 200 301 302 48h; resolver 8.8.4.4 8.8.8.8; diff --git a/ops/nginx_conf/proxy.conf b/ops/nginx_conf/proxy.conf index a14f88f..15648c1 100644 --- a/ops/nginx_conf/proxy.conf +++ b/ops/nginx_conf/proxy.conf @@ -61,8 +61,8 @@ server { proxy_pass_request_headers on; # Response cache. Opt-in per host: $skip_cache is 0 only when the Host - # record sets respcache_enabled. Global default TTL lives in nginx.conf; - # upstream Cache-Control (private/no-store) is still honored. + # record sets respcache_enabled. Global default TTL (48h) lives in + # nginx.conf; upstream Cache-Control (private/no-store) is still honored. proxy_cache proxycache; proxy_cache_key $scheme$host$request_uri; proxy_cache_bypass $skip_cache;