v1.5.0 - Optimistic Caching
⚡ Optimistic Caching (Serve‑Stale)
This release adds optimistic caching – when a cached DNS record expires, phantomd now serves the stale response immediately while refreshing the record in the background. This keeps latency low and improves resilience during brief upstream outages, following RFC 8767.
✨ Added
- Optimistic caching – serve‑stale with configurable max age and TTL for stale responses. Disabled by default; enable with
optimistic_cache_enabled = truein the[advanced]section ofphantomd.conf. Hot‑reloadable viaSIGHUP. - New configuration options –
optimistic_cache_enabled,optimistic_stale_max_age, andoptimistic_stale_response_ttlfully documented in the config template. - Expanded test suite – 5 new tests cover fresh/stale serving, max‑age expiry, duplicate refresh prevention, and disabled behaviour. Total: 88 tests.
🐛 Fixed
- Wire‑cache
query_datastorage – internal cache format updated to store original query data, enabling proper background refresh. - Cache expiry test compatibility – tests now work correctly with all cache backends (
cachetoolsandAsyncTTLCache).
🛠️ Changed
_wire_cache_setsignature – now requires an explicitquery_dataargument to support background refresh. All internal calls updated._set_response_ttlrewritten to rebuild the entire response, guaranteeing TTL changes apply across all dnspython versions.
📦 Upgrading
- Update:
./installer.sh --updatethensystemctl restart phantomd - Fresh install:
./installer.sh
Full Changelog: v1.4.0...v1.5.0