Commit 1d7bdc0
Fix networkFirst handler re-caching responses from cache
The networkFirst handler was calling saveToCache for ALL responses,
including those retrieved from the cache itself. When a cached opaque
response was re-saved after being read with a different request mode
(e.g., redirect: 'manual' from Turbo), the response type could change
from 'opaque' to 'opaqueredirect', corrupting the cached entry.
Now we only cache responses that actually came from the network.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent f70788a commit 1d7bdc0
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | | - | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
0 commit comments