DoH: Assign HTTP responses freshness lifetime according to the smallest TTL found in the Answer section (by setting "max-age" in "Cache-Control" header)
In the DoH spec there is a section on HTTP cache interaction.
We are now trying to bypass the caches. However, in the long run it might be beneficial to take advantage of it by setting
max-age to the least TTL from the answer section. In some cases, this can help us to take advantage of the existing HTTP caching infrastructure and lessen load on the DNS server itself by reusing the HTTP infrastructure caching capabilities.
Adding such a code to
http.c is easy, however, we seem to currently lack a mechanism to track the minimal TTL value in
dns_message. If we were adding one, we could put it into
dns_message, updating the lowest TTL whenever a new rdataset was added to a message.
For the reference, at least Knot Resolver does it, as do Cloudflare and Quad9. So should we.