Repository navigation
Commit 9c2691d
fix(cache): only cache GET/HEAD and never store per-user responses
- Only `GET` and `HEAD` requests read or write the handler cache; other
methods and `Range` requests call the handler directly. `HEAD` uses a
separate key (GET keys unchanged).
- Never store responses that set cookies; `set-cookie` is only sent to the
request that produced the response, and concurrent requests resolve
their own response instead of sharing it.
- Never store responses with `cache-control` private/no-store/no-cache and
keep the handler's own `cache-control`.
- Never store responses whose `vary` is `*` or names a header not in
`varies` (except `accept-encoding`).
- Remove a stored entry when a fresh response is no longer cacheable.
- Capture `appendHeader` in the response proxy (multiple cookies).
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent a676074 commit 9c2691d
8 files changed
Lines changed: 399 additions & 141 deletions
File tree
- docs/1.guide
- src/runtime/internal
- test
- fixture/api/cache
- presets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
| |||
0 commit comments