Respect DNS TTL and HTTP cache age
04The HTTP freshness lifetime cannot exceed the DNS time to live (TTL). Server policy can separately allow reuse after freshness ends.
Reduce the remaining DNS lifetime by the age already elapsed.
Key idea: Freshness and policy-authorized stale reuse are different decisions.
Rules & examples
Freshness and policy-authorized stale reuse are different decisions.
- DoH servers SHOULD assign an explicit HTTP freshness lifetime. It MUST be no greater than the smallest TTL in the DNS Answer section; equality is RECOMMENDED.
- If the Answer section is empty and the Authority section contains an SOA record, HTTP freshness MUST NOT exceed that record’s MINIMUM field. SOA means Start of Authority.
- DoH clients MUST account for HTTP Age when calculating DNS TTL. Receiving a cached response locally does not restart its lifetime.
- At the server’s discretion, stale-while-revalidate or stale-if-error can permit reuse of all of a cached entry that is no longer fresh. This does not make the entry fresh or reset its Age.
The normal example starts with TTL 300 seconds and HTTP Age 100 seconds, leaving 200 seconds. A stale-policy exception is separate: the client reuses the entire cached entry or none of it, at the server’s discretion. It does not start a new freshness lifetime.
Sources
New to this? Start hereA quick picture + helpful background
A request starts a conversation.
A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.