paulehoffman / draft-hoffman-dispatch-dns-over-https

0 stars 0 forks source link

POST request invalidates the cache #4

Open serenheit opened 7 years ago

serenheit commented 7 years ago

According to RFC 2616 POST requests to server forces server to invalidate an entity.

Some HTTP methods MUST cause a cache to invalidate an entity. This is either the entity referred to by the Request-URI, or by the Location or Content-Location headers (if present). These methods are:

  • PUT
  • DELETE
  • POST

In case when we use DNS over HTTP for user-resolver connection, POST requests will cause the server to perform a full lookup of the name again regardless TTL, thus making resolver useless.

mcmanus commented 7 years ago

rfc 7234 obsoletes rfc 2616.. checkout out section 4.4 of that so we're talking modern language.. the essence of what you quote is similar, but I don't draw the conclusion you do

In case when we use DNS over HTTP for user-resolver connection, POST requests will cause the server to perform a full lookup of the name again regardless TTL, thus making resolver useless.

4.4 addresses requirements on intervening caches, but your concern is about the DoH endpoint (i.e. the server). In HTTP lingo that endpoint is a gateway not an intervening cache - and the language does not apply to it. It can generate its response anyway it likes.

But of course intervening HTTP caches are impacted by these rules, which is why the DoH draft notes that POST is less cache friendly.

we should probably have a reference to 7234

serenheit commented 7 years ago

I was thinking about exactly the case of configuring cache on the endpoint (e.g. my homenet router). With the assumption that we taught somehow HTTP server to communicate with resolver around or even (the worst case I described) perform the full DNS resolution process.

I wouldn't call POST "less cache friendly" because it isn't.

Regarding intervening caches I'm a bit confused with final TTL value. Usually when you perform a set of requests to resolver you see the TTL value decrementing. If we cache the answer somewhere, we get the raw format answer with the same TTL value but that should be decremented by the time spent.

mcmanus commented 7 years ago

an http cache hit would necessitate an Age: response header.. the age of the http response is absolutely relevant (always) to interpretation. That should probably be highlighted in the draft.

(I would definitely call POST less cache friendly if for no other reason than in practice cache's just pass it through)