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
Always serve stale cache, 6M TTL, 5y disk retention, CACHE_STALE_TIME env
- Add 'expired' to proxy_cache_use_stale so expired entries are served
immediately while refreshed in the background (fixes MISSes after TTL)
- Bump inactive from 365d to 5y so cache files are never purged from disk
- Change default CACHE_STALE_TIME from 5d to 6M
- Remove unused nginx.conf.template.backup
- Update README to document new defaults and behaviour
A high-performance caching proxy server that sits in front of OWL reasoning services to dramatically speed up query responses. Built on NGINX Alpine with 90-day cache TTL and stale-while-revalidate pattern.
5
+
A high-performance caching proxy server that sits in front of OWL reasoning services to dramatically speed up query responses. Built on NGINX Alpine with a 6-month cache TTL, stale-while-revalidate pattern, and 5-year disk retention so a cached response is always available.
6
6
7
7
## Usage Examples
8
8
@@ -53,7 +53,8 @@ The health endpoint now proxies to the upstream server to verify connectivity. I
53
53
54
54
-`UPSTREAM_SERVER`: Backend server URL (default: `owl.virtualflybrain.org:80`)
55
55
-`CACHE_MAX_SIZE`: Maximum cache size on disk (default: `20g`, accepts NGINX size units like `1t` for 1TB)
56
-
-`DNS_RESOLVER`: DNS resolver servers (default: `8.8.8.8 1.1.1.1`, space-separated list). Check `cat /etc/resolv.conf` in your container to find the correct value for your environment.
56
+
-`CACHE_STALE_TIME`: How long a cached response is considered fresh (default: `6M`). After this time the entry is served stale while being refreshed in the background. Accepts NGINX time units: `s`, `m`, `h`, `d`, `w`, `M` (30 days), `y` (365 days).
57
+
-`DNS_RESOLVER`: DNS resolver servers (default: `8.8.8.8`, space-separated list). Check `cat /etc/resolv.conf` in your container to find the correct value for your environment.
57
58
58
59
### Cache Headers
59
60
@@ -64,7 +65,8 @@ The proxy adds helpful headers to responses:
64
65
65
66
## Performance
66
67
67
-
-**Cache TTL**: 90 days for successful responses
68
+
-**Cache TTL**: 6 months for successful responses (configurable via `CACHE_STALE_TIME`)
69
+
-**Disk retention**: 5 years (`inactive=5y`) — entries are never evicted while disk space allows
68
70
-**First request**: ~200ms (backend query)
69
71
-**Cached requests**: <10ms (from cache)
70
72
-**Cache size**: Up to 20GB on disk (configurable via `CACHE_MAX_SIZE`)
@@ -82,8 +84,9 @@ The proxy adds helpful headers to responses:
82
84
83
85
### Caching Behavior
84
86
85
-
-**Cache TTL**: 90 days for HTTP 200, 10 minutes for 404, errors not cached
-**Cache TTL**: 6 months for HTTP 200/400, 10 minutes for 404 (TTL configurable via `CACHE_STALE_TIME`)
88
+
-**Always serve stale**: `proxy_cache_use_stale expired updating` — expired entries are served immediately while refreshed in the background (prevents MISSes after TTL)
89
+
-**Disk retention**: 5 years — cache files are kept on disk even after TTL expires
87
90
-**Retry on errors**: Automatically retries failed requests (502, 503, 504, timeouts) up to 2 times
88
91
-**Cache lock**: Prevents stampede with `proxy_cache_lock on`
0 commit comments