-
Notifications
You must be signed in to change notification settings - Fork 273
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
Cache Query Responses #90
Comments
Are you sure they are for the exact same host and type? Normally I see one "A" and "AAAA" for each name. However, I do often see a lot of queries under the same main domain, so the queries might look like the same domain if you don't expand the query details. |
I thought I'll leave a few notes of my venture hoping it'll help whoever picks it up for implementation. I looked at the code thinking I might implement it myself if it's very trivial (decorate the resolver somewhere). The project already uses Guava, so Guava's Cache{Builder,Loader} could fit neatly. Not so easy. The Loader requires an isolated method that returns the object to be cached. Currently I don't see any method that returns DnsTransaction. Therefore I believe a refactor is needed somewhere between DnsResolverUdpToHttps and DnsVpnService. You're definitely more familiar with your project's code than I am, so correct my instinct if I'm wrong. |
This change adds DoH-compliant caching and TTL rewriting. It uses Caffeine, a cache framework that supports custom expiration times for each entry and load coalescing, so that a query can be fulfilled from cache if a load action is in progress for that query. Caching is disabled by default, subject to a Firebase remote configuration experiment. Fixes #90
This change adds DoH-compliant caching and TTL rewriting. It uses Caffeine, a cache framework that supports custom expiration times for each entry and load coalescing, so that a query can be fulfilled from cache if a load action is in progress for that query. Caching is disabled by default, subject to a Firebase remote configuration experiment. NOTE: Currently this change is blocked by a compatibility bug in Caffeine: ben-manes/caffeine#293 Fixes #90
It turns out that this was largely happening because of the threading bug that was fixed in #152. With that change, the OS's built-in cache should be sufficient. |
Most of the queries are for the same hosts. Caching the result for sometime could provide significant increase in response time.
The text was updated successfully, but these errors were encountered: