You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add metadata TTL and stale-while-revalidate support
Cached metadata is now served directly within a configurable TTL window
(default 5m) without contacting upstream, reducing latency and upstream
load. When upstream is unreachable and the cache is past its TTL, stale
content is served with a Warning: 110 header per RFC 7234.
New config: `metadata_ttl` (YAML) / `PROXY_METADATA_TTL` (env).
Set to "0" to always revalidate with upstream.
Copy file name to clipboardExpand all lines: docs/configuration.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,6 +225,20 @@ Or via environment variable: `PROXY_CACHE_METADATA=true`.
225
225
226
226
The `proxy mirror` command always enables metadata caching regardless of this setting.
227
227
228
+
### Metadata TTL
229
+
230
+
When metadata caching is enabled, `metadata_ttl` controls how long a cached response is considered fresh before revalidating with upstream. During the TTL window, cached metadata is served directly without contacting upstream, reducing latency and upstream load.
231
+
232
+
```yaml
233
+
metadata_ttl: "5m" # default
234
+
```
235
+
236
+
Or via environment variable: `PROXY_METADATA_TTL=10m`.
237
+
238
+
Set to `"0"` to always revalidate with upstream (ETag-based conditional requests still avoid re-downloading unchanged content).
239
+
240
+
When upstream is unreachable and the cached entry is past its TTL, the proxy serves the stale cached copy with a `Warning: 110 - "Response is Stale"` header so clients can tell the data may be outdated.
241
+
228
242
## Mirror API
229
243
230
244
The `/api/mirror` endpoints are disabled by default. Enable them to allow starting mirror jobs via HTTP:
0 commit comments