Skip to content
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 support for DnsOverHttps.Builder().post(true) #8113

Open
calbot opened this issue Nov 24, 2023 · 4 comments
Open

Cache support for DnsOverHttps.Builder().post(true) #8113

calbot opened this issue Nov 24, 2023 · 4 comments
Labels
enhancement Feature not a bug

Comments

@calbot
Copy link

calbot commented Nov 24, 2023

The Cache class key uses the request url and therefore cannot cache DNS over HTTPS requests when the DNS query address is sent in a Post request with DnsOverHttps.Builder().post(true). When the get form of the DNS request is used it is base64 encoded so it isn't really private which domain is being requested so it would be good to be able to have both privacy of DoH and caching.

@calbot calbot added the enhancement Feature not a bug label Nov 24, 2023
@yschimke
Copy link
Collaborator

@swankjesse I can't see a good way to handle this. We can do a complicated interceptor dance to fool caching. But I think I'm preferring some internal Tag for CacheKey?

@swankjesse
Copy link
Member

@yschimke that’s a good idea. Or this?

class RequestBody {
  ...
  /** 
   * Returns a non-null key if this request can be cached. If non-null,
   * this key is used in combination to the request URL to create the
   * ultimate cache key.
   */
  open fun cacheKey(): ByteString? {
    return null;
  }
}

@yschimke
Copy link
Collaborator

yschimke commented Dec 3, 2023

Yeah that works. And is more constrained. The tag approach would allow mucking with any cache key

@yschimke
Copy link
Collaborator

A similar requirement...

#8211

But wouldn't work with a RequestBody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature not a bug
Projects
None yet
Development

No branches or pull requests

3 participants