Skip to content

v1.5.0 - Optimistic Caching

Choose a tag to compare

@33xception 33xception released this 25 Apr 17:27
· 18 commits to master since this release

⚡ 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 = true in the [advanced] section of phantomd.conf. Hot‑reloadable via SIGHUP.
  • New configuration options – optimistic_cache_enabled, optimistic_stale_max_age, and optimistic_stale_response_ttl fully 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_data storage – 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 (cachetools and AsyncTTLCache).

🛠️ Changed

  • _wire_cache_set signature – now requires an explicit query_data argument to support background refresh. All internal calls updated.
  • _set_response_ttl rewritten to rebuild the entire response, guaranteeing TTL changes apply across all dnspython versions.

📦 Upgrading

  • Update: ./installer.sh --update then systemctl restart phantomd
  • Fresh install: ./installer.sh

Full Changelog: v1.4.0...v1.5.0