diff --git a/.changeset/live-no-store-5335.md b/.changeset/live-no-store-5335.md new file mode 100644 index 000000000..bced910a8 --- /dev/null +++ b/.changeset/live-no-store-5335.md @@ -0,0 +1,5 @@ +--- +"@solidjs/web": patch +--- + +Send `live` and `broadcast` requests with `cache: "no-store"`. A live answer is never cacheable, and without it Firefox held a second tab's request to the same address for about 20 seconds while the first tab's connection was open. diff --git a/packages/web/server-functions/src/client.ts b/packages/web/server-functions/src/client.ts index b2c503c25..99187321d 100644 --- a/packages/web/server-functions/src/client.ts +++ b/packages/web/server-functions/src/client.ts @@ -1504,6 +1504,10 @@ export function live(fn) { while (ends.length) settle(ends.pop(), error); }; const wireOptions = { + // A live answer never ends and is never cacheable: `no-store` also + // keeps Firefox from holding a second tab's request to the same + // url behind the first's open response (#5335). + cache: "no-store", ...invokeOptions, [LIVE_WIRE]: wire, signal: invokeSignal diff --git a/packages/web/test/server-functions-live-loop.spec.tsx b/packages/web/test/server-functions-live-loop.spec.tsx index 992926451..98e7a1956 100644 --- a/packages/web/test/server-functions-live-loop.spec.tsx +++ b/packages/web/test/server-functions-live-loop.spec.tsx @@ -197,6 +197,8 @@ describe("live(): the loop from the consumer's side", () => { expect(calls[0].address).toBe("/_server/live/loop%2Fstream"); // live implies GET expect(calls[0].init.method).toBe("GET"); + // Never cached, and never held behind another tab's open response (#5335). + expect(calls[0].init.cache).toBe("no-store"); expect(states).toEqual(["connected", "closed"]); }); diff --git a/scripts/size/floor-caps.json b/scripts/size/floor-caps.json index c7726a8ab..94734afaa 100644 --- a/scripts/size/floor-caps.json +++ b/scripts/size/floor-caps.json @@ -16,8 +16,8 @@ "minified": 102890 }, "page: live server components (base + live/GET + action + isPending/latest)": { - "cap": "41.82 KB", - "minified": 125750 + "cap": "41.84 KB", + "minified": 125786 }, "server: floor (getRequestEvent + isServer)": { "cap": "1.33 KB", diff --git a/scripts/size/scenarios.js b/scripts/size/scenarios.js index e36405dfe..b94081cc6 100644 --- a/scripts/size/scenarios.js +++ b/scripts/size/scenarios.js @@ -5902,6 +5902,7 @@ module.exports = [ // 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): frozen floor 41.68 KB -> 41.79 KB, recorded minified 125,358 -> 125,464 B, measured at 41,779 B brotli (Size-Exception). Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): frozen floor cap unchanged at 41.79 KB, recorded minified 125,464 -> 125,521 B, measured at 41,724 B brotli. Size-Exception in this PR. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. // Hydration completion and resume fixes (#5320 from #5310/#5312, 2026-12-04, over main @ 5a729a9 after #5319, CI Size run 47317857105): 41.79 KB -> 41.82 KB, recorded minified 125,521 -> 125,750 B, measured at 41,810 B brotli. A pending sibling boundary keeps its server elements when another resumes first (+146 B minified), and a root waiting on its module preload holds hydration open (GH5, +83 B). Accepted by the maintainer 2026-12-04. A frozen floor, Size-Exception in this PR's body. Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. + // 2026-12-05 (#5340 for #5335: a live request is sent with cache: "no-store", so Firefox no longer holds a second tab's live connection behind the first's open response; +17 B minified on the live pages only (the live loop's wire options; plain reads unchanged); CI size check job 145669773133 on 123afcf, over main @ e3bee61; the rest of the minified over the old record is the growth merged since #5320): 41.82 KB -> 41.84 KB, recorded minified 125,750 -> 125,786 B, measured at 41,821 B brotli. Bug fix, under the 20 B brotli threshold for this PR. Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. limit: floorCaps["page: live server components (base + live/GET + action + isPending/latest)"], capMinified: floorMinified["page: live server components (base + live/GET + action + isPending/latest)"], @@ -6306,8 +6307,9 @@ module.exports = [ // An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 123,191 -> 123,249 B (+58 B minified over next's record), measured locally (linux) at 41,899 B brotli. Recorded minified = measured; CI re-bases. // Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 123,203 -> 123,224 B (+21 B minified over next's record), measured locally (linux) at 41,966 B brotli. Recorded minified = measured; CI re-bases. // latest() read inline and through a memo show the same screen (#4284 through a memo; a plain write beside an async memo), 2026-10-29, over next @ 7ebd4a32: recorded minified 123,224 -> 123,733 B (+403 B minified over next), measured locally (linux) at 42,119 B brotli (+169 B over next). A render effect a verdict memo's change re-runs reads as its verdict reader for that pass (`laneDirty`), a pass that read a staging before the frame had a transaction re-derives once as a verdict reader only if the frame parks, `latest()` of a first load in flight in a verdict lane is loading (also through an identity memo, a derived store and `isPending`), a lane's dissolution leaves such a load and the nodes pending on it uninitialized instead of committing `undefined`, a verdict lane born at a seam is judged at it, a pass born in a staged reader stays the frame's on a verdict-memo read (C4, #4010), a plain write beside `latest()` computes once (the seam re-derives a pre-transaction staged reader only if the frame parks), a verdict reader's plain read of a staging in a transaction only a `latest()` opened is the frame's read, so a memo of `latest()` computes once too (D-22; not a pass with no value yet, D-6), and an error stays the display while the memo it came through re-asks, a Loading fallback behind it included (D-39, async-gen 91501 #1831). recompute's CONFIG_VERDICT clear now sits behind the lane engine: -21 B minified on every floor. Correctness; the maintainer: "only flag me if brotli goes more than 20kb" (2026-10-29). Cap unchanged; recorded minified = measured. - limit: "45.99 KB", - capMinified: 134183, + // 2026-12-05 (#5340 for #5335: a live request is sent with cache: "no-store", so Firefox no longer holds a second tab's live connection behind the first's open response; +17 B minified on the live pages only (the live loop's wire options; plain reads unchanged); CI size check job 145669773133 on 123afcf, over main @ e3bee61; the rest of the minified over the old record is the growth merged since #5320): 45.99 KB -> 46.03 KB, recorded minified 134,183 -> 134,219 B, measured at 46,012 B brotli. Bug fix, under the 20 B brotli threshold for this PR. Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. + limit: "46.03 KB", + capMinified: 134219, alias: pageAlias }, { @@ -6796,12 +6798,13 @@ module.exports = [ // 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): 51.64 KB -> 51.69 KB, recorded minified 151,413 -> 151,519 B, measured at 51,671 B brotli. Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): cap unchanged at 51.69 KB, recorded minified 151,519 -> 151,576 B, measured at 51,646 B brotli. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. // Hydration completion and resume fixes (#5320 from #5310/#5312, 2026-12-04, over main @ 5a729a9 after #5319, CI Size run 47317857105): 51.69 KB -> 51.74 KB, recorded minified 151,576 -> 151,805 B, measured at 51,727 B brotli. A pending sibling boundary keeps its server elements when another resumes first (+146 B minified), and a root waiting on its module preload holds hydration open (GH5, +83 B). Accepted by the maintainer 2026-12-04. Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. - limit: "51.74 KB", + // 2026-12-05 (#5340 for #5335: a live request is sent with cache: "no-store", so Firefox no longer holds a second tab's live connection behind the first's open response; +17 B minified on the live pages only (the live loop's wire options; plain reads unchanged); CI size check job 145669773133 on 123afcf, over main @ e3bee61; the rest of the minified over the old record is the growth merged since #5320): 51.74 KB -> 51.78 KB, recorded minified 151,805 -> 151,841 B, measured at 51,765 B brotli. Bug fix, under the 20 B brotli threshold for this PR. Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured. + limit: "51.78 KB", // An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 140,451 -> 140,509 B (+58 B minified over next's record), measured locally (linux) at 47,516 B brotli. Recorded minified = measured; CI re-bases. // Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 140,463 -> 140,485 B (+22 B minified over next's record), measured locally (linux) at 47,547 B brotli. Recorded minified = measured; CI re-bases. // latest() read inline and through a memo show the same screen (#4284 through a memo; a plain write beside an async memo), 2026-10-29, over next @ 7ebd4a32: recorded minified 140,485 -> 140,983 B (+405 B minified over next), measured locally (linux) at 47,722 B brotli (+162 B over next). A render effect a verdict memo's change re-runs reads as its verdict reader for that pass (`laneDirty`), a pass that read a staging before the frame had a transaction re-derives once as a verdict reader only if the frame parks, `latest()` of a first load in flight in a verdict lane is loading (also through an identity memo, a derived store and `isPending`), a lane's dissolution leaves such a load and the nodes pending on it uninitialized instead of committing `undefined`, a verdict lane born at a seam is judged at it, a pass born in a staged reader stays the frame's on a verdict-memo read (C4, #4010), a plain write beside `latest()` computes once (the seam re-derives a pre-transaction staged reader only if the frame parks), a verdict reader's plain read of a staging in a transaction only a `latest()` opened is the frame's read, so a memo of `latest()` computes once too (D-22; not a pass with no value yet, D-6), and an error stays the display while the memo it came through re-asks, a Loading fallback behind it included (D-39, async-gen 91501 #1831). recompute's CONFIG_VERDICT clear now sits behind the lane engine: -21 B minified on every floor. Correctness; the maintainer: "only flag me if brotli goes more than 20kb" (2026-10-29). Cap unchanged; recorded minified = measured. // 2026-11-19 (#5055: markRaw accepts a class; CI size head job 135428351139 on 8d9bf2b, over main @ 7f86b2d): recorded minified 150,907 -> 150,927 B, measured 51,339 B brotli; cap unchanged. Recorded minified = measured. - capMinified: 151805, + capMinified: 151841, alias: pageAlias, conditions: solidConditions, compile: { hydratable: true }