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;