304 responses should contain etag #3286
Labels
bug
Something isn't working
help wanted
PRs welcomed. The implementation details are unlikely to cause debate
p2-nice-to-have
SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Describe the bug
Currently the correct headers are missing on 304 responses.
The IETF standards i founds say this:
The server generating a 304 response MUST generate any of the following header fields that would have been sent in a 200 (OK) response to the same request: Cache-Control, Content-Location, Date, ETag, Expires, and Vary.
https://datatracker.ietf.org/doc/html/rfc7232#section-4.1
kit/packages/kit/src/runtime/server/index.js
Lines 118 to 140 in b10ba93
For me this causes cloudflare caching to not revalidate my api responses correctly when a
cache-control: max-age=60
header was set. Cloudflare support was so kind to point me to this issue.Reproduction
Can create a repo if requested
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
I would suggest the following change to fix this issue.
The text was updated successfully, but these errors were encountered: