http-extensions icon indicating copy to clipboard operation
http-extensions copied to clipboard

query: review caching requirements

Open reschke opened this issue 4 months ago • 8 comments

(follow up to https://github.com/httpwg/http-extensions/issues/2896)

Currently:

2.4. Caching

The response to a QUERY method is cacheable; a cache MAY use it to satisfy subsequent QUERY requests as per Section 4 of [HTTP-CACHING]). The cache key for a QUERY request (see Section 2 of [HTTP-CACHING]) MUST incorporate the request content. When doing so, caches SHOULD first normalize request content to remove semantically insignificant differences, thereby improving cache efficiency, by:

  • Removing content encoding(s) (Section 8.4 of [HTTP]).
  • Normalizing based upon knowledge of format conventions, as indicated by any media subtype suffix in the request's Content-Type field (e.g., "+json", see Section 4.2.8 of [RFC6838]).
  • Normalizing based upon knowledge of the semantics of the content itself, as indicated by the request's Content-Type field.

Note that any such normalization is performed solely for the purpose of generating a cache key; it does not change the request itself.

Issues:

  1. "... MUST incorporate the request content" - that's misleading, because any kind of stable indentifier (such as a SHA-256 of (normalized) content) should be good enough
  2. "When doing so..." means "When responses are cached...", right?
  3. "...SHOULD first normalize..." is misleading, as all the steps that follow are more or less optional ... "...can normalize..." or "...are encouraged to normalize..." maybe?
  4. "remove semantically insignificant differences, thereby improving cache efficiency, by" -> "remove semantically insignificant differences, thereby improving cache efficiency. For instance, by"

@mnot - does this make sense?

reschke avatar Jun 09 '25 16:06 reschke