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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user