-
Notifications
You must be signed in to change notification settings - Fork 559
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
Easier way to attach ETag
to If-None-Match
after #3562
#3718
Comments
I have a question. In the fetch spec, 304 (along with some other status codes like 101 and 204) are null body status (https://fetch.spec.whatwg.org/#concept-status). undici could return a "transparent" cached But in the context of Node.js, some people might also want to know whether the response is from cached or not. |
We haven't really assessed if/how this would integrate with fetch. |
Closes nodejs#3718 Signed-off-by: flakey5 <[email protected]>
We currently use make-fetch-happen and their |
I am also using But with undici, it is possible to use |
This would solve...
#3562 introduces HTTP Caching (RFC9110) to undici, which also implements HTTP 304 with
If-Modified-Since
. But it seems thatETag
is missing.cc @flakey5
The implementation should look like...
IMHO #3562 should not be delayed anymore, this could be implemented after #3562 is merged.
The
undici
could check the storedETag
header from the cache store and use that to negotiate with theIf-None-Match
in future requests. If the server returns HTTP 304, undici would then return the cached (transparent) HTTP 200 response to the client (the same behavior offetch
as in browsers).Additional context
#3562
JakeChampion/fetch#241
ETag
is described in RFC9110 here: https://httpwg.org/specs/rfc9110.html#field.etagIf-None-Match
is described in RFC9110 here: https://httpwg.org/specs/rfc9110.html#field.if-none-matchHTTP 304 is described in RFC9110 here: https://httpwg.org/specs/rfc9110.html#status.304
The handling of HTTP 304 is described in RFC9110 here: https://httpwg.org/specs/rfc9111.html#freshening.responses
The text was updated successfully, but these errors were encountered: