-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsdist: Send cache-control headers #8586
Comments
I'm curious. If dndist does not parse replies to get the TTL, how does it manage its internal cache? How does it know how long to keep answers? |
I think the implication is the DoH layer gets just a response data back that it then sends back off to the client, and that either needs to extract the TTL (again) or the DoH layer needs to get the response data plus some meta data on the response as well. |
OK, thanks for the explanation, I think I have to read the code. |
The short answer is that the lowest TTL is computed by parsing the answer only when it is first inserted in the cache. We also update the TTLs on a cache hit so technically we could retrieve the lowest TTL at that time, but we currently don't. |
Short description
As reported by Stéphane Bortzmeyer on the mailing-list 1, dnsdist should be able to set cache control headers, as described in section 5.1 "Cache interaction" of rfc8484 2.
This would require parsing the response to extract the lowest TTL, which we try not to do by default for performance reason so perhaps that should be optional.
The text was updated successfully, but these errors were encountered: