The operator can clamp cache TTLs and keep the forwarding cache across a restart #238

Open
opened 2026-10-31 12:42:32 -04:00 by claude · 0 comments
Owner
  • Draft: PN-49
  • Priority: low (deferred)
  • Agent: coder
  • Depends on: #75
  • Decisions: none

Why

A forwarding cache now exists (ForwardingOptions.EnableCache/MaxCacheEntries, src/dotnet/src/Ninlil.Dns.Server.Forwarding/ForwardingOptions.cs:59,68). There is no minimum or maximum TTL override, and no persistence. #75 adds a ValKey second level to the same cache first.

What changes

  • MinimumCacheTimeToLive/MaximumCacheTimeToLive in ForwardingOptions and RecursiveServerOptions, applied when an entry is stored (Caching/ForwardedResponseCache.cs, Ninlil.Dns.Server.Recursive/Caching/RecursiveCache.cs). The clamp applies before a value is written to the shared ValKey store (#75), so every node reads the clamped lifetime. Clamping lowers TTL compliance (RFC 1035 §3.2.1, RFC 2181 §8), so the docs say so.
  • Optional snapshot to the data directory on shutdown and load on start (local level only).
  • ENVIRONMENT.md. Settings API changes go to follow-up api-regen and console issues.

Acceptance

  • This test fails first: Store_WithAMinimumTtl_RaisesAShortTtl.
  • Test: with a fake shared store, the value written carries the clamped expiry.
  • Gate: dotnet test src/dotnet/tests/Ninlil.Dns.Server.Forwarding.Tests, dotnet test src/dotnet/tests/Ninlil.Dns.Server.Recursive.Tests.

Source

audit-feature-parity.md §2B #20; DEDUPE.md P5.

- **Draft:** PN-49 - **Priority:** low (deferred) - **Agent:** coder - **Depends on:** #75 - **Decisions:** none ### Why A forwarding cache now exists (`ForwardingOptions.EnableCache`/`MaxCacheEntries`, `src/dotnet/src/Ninlil.Dns.Server.Forwarding/ForwardingOptions.cs:59,68`). There is no minimum or maximum TTL override, and no persistence. #75 adds a ValKey second level to the same cache first. ### What changes - `MinimumCacheTimeToLive`/`MaximumCacheTimeToLive` in `ForwardingOptions` and `RecursiveServerOptions`, applied when an entry is stored (`Caching/ForwardedResponseCache.cs`, `Ninlil.Dns.Server.Recursive/Caching/RecursiveCache.cs`). The clamp applies before a value is written to the shared ValKey store (#75), so every node reads the clamped lifetime. Clamping lowers TTL compliance (RFC 1035 §3.2.1, RFC 2181 §8), so the docs say so. - Optional snapshot to the data directory on shutdown and load on start (local level only). - ENVIRONMENT.md. Settings API changes go to follow-up api-regen and console issues. ### Acceptance - [ ] This test fails first: `Store_WithAMinimumTtl_RaisesAShortTtl`. - [ ] Test: with a fake shared store, the value written carries the clamped expiry. - [ ] Gate: `dotnet test src/dotnet/tests/Ninlil.Dns.Server.Forwarding.Tests`, `dotnet test src/dotnet/tests/Ninlil.Dns.Server.Recursive.Tests`. ### Source `audit-feature-parity.md` §2B #20; DEDUPE.md P5.
claude added this to the (deleted) milestone 2026-10-31 12:42:32 -04:00
claude removed this from the (deleted) milestone 2026-11-06 12:28:38 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#238
No description provided.