@rangojs/router 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/types/browser/cookie-name.d.ts +6 -0
- package/dist/types/browser/history-state.d.ts +16 -0
- package/dist/types/cache/cache-key-utils.d.ts +17 -2
- package/dist/types/cache/cache-policy.d.ts +17 -0
- package/dist/types/cache/cache-scope.d.ts +98 -14
- package/dist/types/cache/cache-tag.d.ts +92 -7
- package/dist/types/cache/cf/cf-base64.d.ts +6 -0
- package/dist/types/cache/cf/cf-cache-constants.d.ts +11 -0
- package/dist/types/cache/cf/cf-cache-store.d.ts +185 -44
- package/dist/types/cache/cf/cf-cache-types.d.ts +31 -4
- package/dist/types/cache/cf/cf-shell-frame.d.ts +95 -0
- package/dist/types/cache/cf/cf-tag-marker-memo.d.ts +34 -0
- package/dist/types/cache/handle-snapshot.d.ts +4 -3
- package/dist/types/cache/index.d.ts +1 -0
- package/dist/types/cache/isolate-tag-memo.d.ts +149 -0
- package/dist/types/cache/shell-memo.d.ts +178 -0
- package/dist/types/cache/shell-snapshot.d.ts +110 -21
- package/dist/types/cache/tag-invalidation.d.ts +30 -3
- package/dist/types/cache/types.d.ts +207 -43
- package/dist/types/cache/vercel/vercel-cache-store.d.ts +111 -13
- package/dist/types/prerender/build-shell-capture.d.ts +11 -4
- package/dist/types/router/instrument.d.ts +8 -0
- package/dist/types/router/middleware-types.d.ts +6 -1
- package/dist/types/router/segment-resolution/loader-cache.d.ts +40 -11
- package/dist/types/router/segment-resolution/loader-snapshot.d.ts +21 -10
- package/dist/types/router/segment-resolution/mask-nested.d.ts +65 -24
- package/dist/types/rsc/full-payload.d.ts +14 -0
- package/dist/types/rsc/handler.d.ts +1 -1
- package/dist/types/rsc/shell-build-manifest.d.ts +8 -0
- package/dist/types/rsc/shell-capture-constants.d.ts +53 -6
- package/dist/types/rsc/shell-capture.d.ts +146 -15
- package/dist/types/rsc/shell-serve.d.ts +140 -17
- package/dist/types/rsc/types.d.ts +7 -0
- package/dist/types/server/context.d.ts +109 -15
- package/dist/types/server/cookie-store.d.ts +21 -0
- package/dist/types/server/request-context.d.ts +159 -33
- package/dist/types/ssr/index.d.ts +9 -0
- package/dist/types/ssr/ssr-root.d.ts +9 -8
- package/dist/types/testing/flight.entry.d.ts +7 -0
- package/dist/types/testing/run-loader.d.ts +18 -3
- package/dist/types/testing/serve-shell-request.d.ts +132 -0
- package/dist/types/testing/shell-status.d.ts +23 -10
- package/dist/types/types/handler-context.d.ts +14 -1
- package/dist/types/urls/pattern-types.d.ts +22 -18
- package/dist/types/vite/router-discovery.d.ts +29 -2
- package/dist/vite/index.js +46 -9
- package/package.json +1 -1
- package/skills/breadcrumbs/SKILL.md +17 -7
- package/skills/cache-guide/SKILL.md +123 -51
- package/skills/caching/SKILL.md +253 -23
- package/skills/catalog.json +1 -1
- package/skills/client-urls/SKILL.md +11 -6
- package/skills/cloudflare/SKILL.md +15 -0
- package/skills/comparison/references/framework-comparison.md +44 -32
- package/skills/defer-hydration/SKILL.md +50 -30
- package/skills/deployment-caching/SKILL.md +5 -2
- package/skills/document-cache/SKILL.md +8 -2
- package/skills/handler-use/SKILL.md +2 -0
- package/skills/hooks/handle-and-actions.md +3 -1
- package/skills/hooks/state.md +3 -1
- package/skills/loader/SKILL.md +161 -39
- package/skills/middleware/SKILL.md +16 -9
- package/skills/migrate-nextjs/SKILL.md +67 -36
- package/skills/migrate-react-router/SKILL.md +2 -1
- package/skills/migrate-react-router/component-migration.md +3 -1
- package/skills/migrate-react-router/data-and-actions.md +3 -1
- package/skills/migrate-react-router/route-mapping.md +7 -4
- package/skills/observability/SKILL.md +64 -0
- package/skills/parallel/SKILL.md +13 -8
- package/skills/ppr/SKILL.md +655 -363
- package/skills/prerender/SKILL.md +27 -14
- package/skills/rango/SKILL.md +52 -33
- package/skills/route/SKILL.md +12 -7
- package/skills/router-setup/SKILL.md +4 -2
- package/skills/scripts/SKILL.md +8 -1
- package/skills/server-actions/SKILL.md +11 -0
- package/skills/shell-manifest/SKILL.md +21 -12
- package/skills/testing/SKILL.md +25 -21
- package/skills/testing/cache-prerender.md +15 -14
- package/skills/testing/loader.md +18 -1
- package/skills/testing/serve-shell-request.md +188 -0
- package/skills/theme/SKILL.md +52 -4
- package/skills/typesafety/env-and-bindings.md +10 -2
- package/skills/use-cache/SKILL.md +39 -16
- package/skills/vercel/SKILL.md +14 -2
- package/skills/view-transitions/SKILL.md +1 -1
- package/src/browser/cookie-name.ts +23 -0
- package/src/browser/history-state.ts +23 -0
- package/src/browser/rsc-router.tsx +5 -0
- package/src/cache/cache-key-utils.ts +22 -2
- package/src/cache/cache-policy.ts +22 -0
- package/src/cache/cache-runtime.ts +34 -7
- package/src/cache/cache-scope.ts +345 -33
- package/src/cache/cache-tag.ts +375 -11
- package/src/cache/cf/cf-base64.ts +36 -4
- package/src/cache/cf/cf-cache-constants.ts +12 -0
- package/src/cache/cf/cf-cache-store.ts +990 -348
- package/src/cache/cf/cf-cache-types.ts +32 -4
- package/src/cache/cf/cf-shell-frame.ts +258 -0
- package/src/cache/cf/cf-tag-marker-memo.ts +143 -39
- package/src/cache/handle-snapshot.ts +4 -3
- package/src/cache/index.ts +2 -0
- package/src/cache/isolate-tag-memo.ts +308 -0
- package/src/cache/shell-memo.ts +341 -0
- package/src/cache/shell-snapshot.ts +217 -27
- package/src/cache/tag-invalidation.ts +104 -19
- package/src/cache/types.ts +211 -43
- package/src/cache/vercel/vercel-cache-store.ts +545 -61
- package/src/prerender/build-shell-capture.ts +65 -11
- package/src/route-definition/dsl-helpers.ts +4 -3
- package/src/router/handler-context.ts +38 -4
- package/src/router/instrument.ts +54 -2
- package/src/router/intercept-resolution.ts +19 -7
- package/src/router/loader-resolution.ts +63 -32
- package/src/router/match-api.ts +28 -9
- package/src/router/match-handlers.ts +5 -0
- package/src/router/match-middleware/cache-lookup.ts +17 -0
- package/src/router/match-middleware/cache-store.ts +31 -11
- package/src/router/middleware-types.ts +6 -1
- package/src/router/middleware.ts +23 -4
- package/src/router/prerender-match.ts +6 -0
- package/src/router/segment-resolution/fresh.ts +18 -9
- package/src/router/segment-resolution/helpers.ts +4 -2
- package/src/router/segment-resolution/loader-cache.ts +227 -56
- package/src/router/segment-resolution/loader-snapshot.ts +203 -51
- package/src/router/segment-resolution/mask-nested.ts +136 -42
- package/src/router/segment-resolution/revalidation.ts +27 -10
- package/src/rsc/full-payload.ts +25 -1
- package/src/rsc/handler.ts +14 -2
- package/src/rsc/progressive-enhancement.ts +3 -2
- package/src/rsc/response-cache-serve.ts +9 -6
- package/src/rsc/rsc-rendering.ts +601 -181
- package/src/rsc/shell-build-manifest.ts +27 -9
- package/src/rsc/shell-capture-constants.ts +60 -6
- package/src/rsc/shell-capture.ts +1001 -250
- package/src/rsc/shell-serve.ts +316 -34
- package/src/rsc/types.ts +7 -0
- package/src/server/context.ts +219 -28
- package/src/server/cookie-store.ts +87 -62
- package/src/server/request-context.ts +263 -38
- package/src/ssr/index.tsx +96 -37
- package/src/ssr/ssr-root.tsx +9 -8
- package/src/testing/flight.entry.ts +14 -0
- package/src/testing/run-loader.ts +63 -5
- package/src/testing/serve-shell-request.ts +378 -0
- package/src/testing/shell-status.ts +34 -12
- package/src/theme/ThemeProvider.tsx +7 -6
- package/src/types/handler-context.ts +14 -1
- package/src/urls/pattern-types.ts +22 -18
- package/src/vite/discovery/shell-prerender-phase.ts +9 -0
- package/src/vite/router-discovery.ts +14 -4
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-isolate tag-marker memos shared by the built-in stores (issue #941;
|
|
3
|
+
* docs/design/shell-entry-layout.md "The tag-marker memo").
|
|
4
|
+
*
|
|
5
|
+
* A tagged shell HIT waits for its tag-invalidation markers before the first
|
|
6
|
+
* byte. Two things here shorten that wait:
|
|
7
|
+
*
|
|
8
|
+
* - {@link TagNameHints}: which tag NAMES a shell key carried last time, so a
|
|
9
|
+
* HIT can start the marker reads alongside the entry read instead of after
|
|
10
|
+
* the entry's head names its tags. Never marker values.
|
|
11
|
+
* - {@link TagMarkerMemo}: the marker VALUES (a tag's latest invalidatedAt,
|
|
12
|
+
* or null), served stale-while-revalidate. A value younger than
|
|
13
|
+
* `markerFreshMs` is used as is; one younger than `markerMaxStaleMs` is used
|
|
14
|
+
* and refreshed from the store in the background; an older one blocks on
|
|
15
|
+
* the store read as before.
|
|
16
|
+
*
|
|
17
|
+
* Simple reads get SWR; a mutation gets correct reads. The request that runs
|
|
18
|
+
* updateTag()/revalidateTag() reads its own writes through the per-request
|
|
19
|
+
* memo; the isolate that runs it writes the new value through into this memo;
|
|
20
|
+
* and its response sets the fresh-reads cookie (request-context.ts), so the
|
|
21
|
+
* same user's next requests on OTHER isolates skip this memo and the shell
|
|
22
|
+
* memo for as long as either can be stale. Other users can see a marker up to
|
|
23
|
+
* `markerMaxStaleMs` old, on top of the platform's own consistency
|
|
24
|
+
* (Cloudflare KV is eventually consistent across locations, up to about 60 s;
|
|
25
|
+
* Vercel's `tm` markers are regional).
|
|
26
|
+
*
|
|
27
|
+
* Only PPR shell reads use the value memo. Cached data families (`cache()`,
|
|
28
|
+
* `"use cache"`, responses) and the shell write gate
|
|
29
|
+
* (`isTagsInvalidatedSince`) keep reading their markers, in every request,
|
|
30
|
+
* whatever its shell read found: a shell read's memoized values never reach
|
|
31
|
+
* the data families' per-request memo (cf-tag-marker-memo.ts
|
|
32
|
+
* ShellMarkerReads).
|
|
33
|
+
*/
|
|
34
|
+
import type { RequestContext } from "../server/request-context.js";
|
|
35
|
+
import type { ShellReadStats } from "./types.js";
|
|
36
|
+
/** Default freshness of a memoized marker on CFCacheStore (ms). */
|
|
37
|
+
export declare const DEFAULT_CF_MARKER_FRESH_MS = 1000;
|
|
38
|
+
/** Default freshness of a memoized marker on VercelCacheStore (ms). */
|
|
39
|
+
export declare const DEFAULT_VERCEL_MARKER_FRESH_MS = 300;
|
|
40
|
+
/** Default oldest memoized marker served while it refreshes (ms), CF. */
|
|
41
|
+
export declare const DEFAULT_CF_MARKER_MAX_STALE_MS = 10000;
|
|
42
|
+
/**
|
|
43
|
+
* The same cap on VercelCacheStore: the runtime cache expires tags globally
|
|
44
|
+
* within about 300 ms, so a much longer stale window would widen that for
|
|
45
|
+
* other users more than KV's own up-to-60 s cross-location lag does on CF.
|
|
46
|
+
*/
|
|
47
|
+
export declare const DEFAULT_VERCEL_MARKER_MAX_STALE_MS = 2000;
|
|
48
|
+
/**
|
|
49
|
+
* Most shell keys a hint map holds (least recently used evicted).
|
|
50
|
+
* @internal Exported for tests that fill the map to its cap.
|
|
51
|
+
*/
|
|
52
|
+
export declare const TAG_HINTS_MAX_ENTRIES = 2048;
|
|
53
|
+
/** How a marker read was answered, for the debugPerformance marker row. */
|
|
54
|
+
export type MarkerMemoOutcome = "fresh" | "stale" | "read" | "bypass";
|
|
55
|
+
/** A memoized marker a read may use: its value, and whether it is stale. */
|
|
56
|
+
export interface MarkerMemoHit {
|
|
57
|
+
value: number | null;
|
|
58
|
+
stale: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A store read of a marker for {@link TagMarkerMemo.readThrough}: the value,
|
|
62
|
+
* and whether it may be memoized (a timed-out read that failed open may not).
|
|
63
|
+
*/
|
|
64
|
+
export interface MarkerFetch {
|
|
65
|
+
value: number | null;
|
|
66
|
+
memoize: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** Options of {@link TagMarkerMemo.readThrough}. */
|
|
69
|
+
export interface MarkerReadThroughOptions {
|
|
70
|
+
/** Fresh window (ms); 0 or less reads the store and memoizes nothing. */
|
|
71
|
+
freshMs: number;
|
|
72
|
+
/** The oldest value served while it refreshes (ms). */
|
|
73
|
+
maxStaleMs: number;
|
|
74
|
+
/** The request carries the fresh-reads cookie: read the store. */
|
|
75
|
+
bypass: boolean;
|
|
76
|
+
/** Keeps a background refresh alive after the response (waitUntil). */
|
|
77
|
+
keepAlive?: (pending: Promise<void>) => void;
|
|
78
|
+
/** How the read was answered, for the debugPerformance marker row. */
|
|
79
|
+
onOutcome?: (outcome: MarkerMemoOutcome) => void;
|
|
80
|
+
}
|
|
81
|
+
export declare class TagMarkerMemo {
|
|
82
|
+
private readonly maxEntries;
|
|
83
|
+
private readonly slots;
|
|
84
|
+
private readonly refreshing;
|
|
85
|
+
constructor(maxEntries?: number);
|
|
86
|
+
/**
|
|
87
|
+
* The memoized marker for `key` if it is younger than `maxStaleMs` (stale
|
|
88
|
+
* when older than `freshMs`), or undefined when the caller must read the
|
|
89
|
+
* store. `freshMs <= 0` disables the memo.
|
|
90
|
+
*/
|
|
91
|
+
lookup(key: string, freshMs: number, maxStaleMs: number, now?: number): MarkerMemoHit | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Record a marker the store returned to a read that started at
|
|
94
|
+
* `readStartedAt`. The age counts from the read's start, not its end: a
|
|
95
|
+
* marker written while the read was in flight may be missing from it, so
|
|
96
|
+
* the value is only known to be current as of the start. Markers only move
|
|
97
|
+
* forward, so a value older than one already held (a write-through that
|
|
98
|
+
* landed during the read) is kept at the newer value, with the later stamp.
|
|
99
|
+
*/
|
|
100
|
+
store(key: string, value: number | null, readStartedAt?: number): void;
|
|
101
|
+
/**
|
|
102
|
+
* Refresh a stale marker in the background: one read per key at a time,
|
|
103
|
+
* handed to `keepAlive` (the store's waitUntil) so the runtime lets it
|
|
104
|
+
* finish after the response; without it the read runs detached. A read
|
|
105
|
+
* that fails, or may not be memoized, stores nothing.
|
|
106
|
+
*/
|
|
107
|
+
refresh(key: string, read: () => Promise<MarkerFetch>, keepAlive?: (pending: Promise<void>) => void): void;
|
|
108
|
+
/**
|
|
109
|
+
* A marker through the memo, stale-while-revalidate: a value within
|
|
110
|
+
* `freshMs` is used as is; one within `maxStaleMs` is used while one
|
|
111
|
+
* background read refreshes it; otherwise, and for a request carrying the
|
|
112
|
+
* fresh-reads cookie, the store is read (`fetch(false)`) and the result
|
|
113
|
+
* memoized. `fetch(true)` is the background refresh, outside any request.
|
|
114
|
+
*/
|
|
115
|
+
readThrough(key: string, fetch: (background: boolean) => Promise<MarkerFetch>, options: MarkerReadThroughOptions): Promise<number | null>;
|
|
116
|
+
clear(): void;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The tag names a shell key's entry carried when it was last read or written
|
|
120
|
+
* in this isolate, so the next HIT can start their marker reads before the
|
|
121
|
+
* entry names them. A wrong or missing hint costs a wasted read or nothing;
|
|
122
|
+
* the freshness check always uses the entry's own tags.
|
|
123
|
+
*/
|
|
124
|
+
export declare class TagNameHints {
|
|
125
|
+
private readonly maxEntries;
|
|
126
|
+
private readonly keys;
|
|
127
|
+
constructor(maxEntries?: number);
|
|
128
|
+
get(key: string): readonly string[] | undefined;
|
|
129
|
+
remember(key: string, tags: readonly string[] | undefined): void;
|
|
130
|
+
clear(): void;
|
|
131
|
+
}
|
|
132
|
+
/** The union of a key's remembered tag names and the route's static tags. */
|
|
133
|
+
export declare function hintedTags(remembered: readonly string[] | undefined, routeTags: readonly string[] | undefined): string[];
|
|
134
|
+
/**
|
|
135
|
+
* The marker row's memo outcome for a read's tags: the most store-bound one
|
|
136
|
+
* (a bypass or store read outranks a stale value, which outranks a fresh one).
|
|
137
|
+
*/
|
|
138
|
+
export declare function summarizeMarkerOutcomes(tags: readonly string[] | undefined, outcomes: ReadonlyMap<string, MarkerMemoOutcome>): MarkerMemoOutcome | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Fill a shell read's marker-row stats (debugPerformance) for the entry's
|
|
141
|
+
* own tags: the memo outcome, and how many of them the read had hinted.
|
|
142
|
+
*/
|
|
143
|
+
export declare function recordMarkerRow(stats: ShellReadStats, tags: readonly string[] | undefined, outcomes: ReadonlyMap<string, MarkerMemoOutcome> | undefined): void;
|
|
144
|
+
/**
|
|
145
|
+
* True when this request carries the fresh-reads cookie: a request of the same
|
|
146
|
+
* user after an updateTag()/revalidateTag(), which must not be served from an
|
|
147
|
+
* isolate memo (shell or marker) that could predate the mutation.
|
|
148
|
+
*/
|
|
149
|
+
export declare function freshReadsRequired(ctx: Pick<RequestContext, "_freshReads"> | undefined): boolean;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-isolate memo of fresh PPR shell reads (issue #941, decision 1;
|
|
3
|
+
* docs/design/shell-entry-layout.md).
|
|
4
|
+
*
|
|
5
|
+
* A warm isolate serving the same shell many times a second re-reads, and
|
|
6
|
+
* re-parses, the same stored entry on every HIT. The store keeps the last
|
|
7
|
+
* fresh read per key for a short window (`memo.shellMs`) and serves the next
|
|
8
|
+
* HIT from memory. What the memo does NOT skip is the part that decides
|
|
9
|
+
* whether the entry may be served: the store still runs its tag-marker check
|
|
10
|
+
* on every read, so with KV bound `updateTag()` / `revalidateTag()` stay
|
|
11
|
+
* immediate across isolates. The isolate that runs the invalidation drops its
|
|
12
|
+
* own copies and keeps reads that were in flight from memoizing them again
|
|
13
|
+
* (RecentTagInvalidations). What another isolate can serve for up to one
|
|
14
|
+
* window: a newer capture of the same key; a KV-less purge-mode purge; on
|
|
15
|
+
* Vercel, an invalidation from another region (tag markers are regional) and
|
|
16
|
+
* a platform `expireTag` issued outside rango (it writes no tag marker).
|
|
17
|
+
*
|
|
18
|
+
* Store instances are usually created per request, so the memo must outlive
|
|
19
|
+
* them: CFCacheStore keeps one module-level memo per isolate, VercelCacheStore
|
|
20
|
+
* one per runtime-cache handle (the handle carries the namespace). One byte
|
|
21
|
+
* budget (`memo.shellMaxBytes`) caps a memo; storing sweeps entries past their
|
|
22
|
+
* window, then evicts the least recently used. Measured on a 3.2 MB shell
|
|
23
|
+
* (Node 22 heap): CFCacheStore holds 1.08x what it counts (prelude plus
|
|
24
|
+
* snapshot JSON); VercelCacheStore holds 0.93x (envelope JSON plus the
|
|
25
|
+
* decoded prelude).
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Per-isolate memos a built-in store keeps (`CFCacheStore`: one per isolate;
|
|
29
|
+
* `VercelCacheStore`: one per `cache` handle). A window of 0 turns that memo
|
|
30
|
+
* off.
|
|
31
|
+
*/
|
|
32
|
+
export interface StoreMemoOptions {
|
|
33
|
+
/**
|
|
34
|
+
* PPR shell memo window (ms): after a shell read, the next HITs of that key
|
|
35
|
+
* within the window are served from memory, with no store read and no
|
|
36
|
+
* parse. Only a fresh shell whose snapshot read completed is kept. The
|
|
37
|
+
* tag-marker check still runs on every HIT, and the isolate that runs
|
|
38
|
+
* `updateTag()` / `revalidateTag()` drops its own copies, so neither that
|
|
39
|
+
* request nor a later one on the same isolate gets the invalidated shell.
|
|
40
|
+
* What ANOTHER isolate can serve for up to one window:
|
|
41
|
+
* - a newer capture of the same key;
|
|
42
|
+
* - `CFCacheStore` without KV, in purge mode: a purged shell. The purge
|
|
43
|
+
* removes the stored entry, not other isolates' memos;
|
|
44
|
+
* - `VercelCacheStore`: an invalidation from another region (the tag
|
|
45
|
+
* markers are a regional `cache.set`; only `expireTag` is global), and a
|
|
46
|
+
* platform `expireTag` issued outside rango.
|
|
47
|
+
*
|
|
48
|
+
* The mutating user is not served these: the response of a request that
|
|
49
|
+
* ran `updateTag()` / `revalidateTag()` sets the fresh-reads cookie, and
|
|
50
|
+
* requests carrying it skip the memos. Set `{ shellMs: 0, markerFreshMs: 0 }`
|
|
51
|
+
* where every user's next request must see an invalidation (with KV,
|
|
52
|
+
* `CFCacheStore`'s marker memo alone can serve an invalidated shell for up
|
|
53
|
+
* to `markerMaxStaleMs`). Default 2000.
|
|
54
|
+
*/
|
|
55
|
+
shellMs?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Total bytes (prelude plus snapshot) the shell memo may hold; the least
|
|
58
|
+
* recently used shells are evicted first, and a shell larger than the whole
|
|
59
|
+
* budget is not kept. Default 16 MiB. 0 turns the memo off.
|
|
60
|
+
*/
|
|
61
|
+
shellMaxBytes?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Tag-marker memo for PPR shell reads: a tag's invalidation marker read
|
|
64
|
+
* within this many ms is used without a store read. Default 1000 on
|
|
65
|
+
* `CFCacheStore` (with KV; without KV there are no markers), 300 on
|
|
66
|
+
* `VercelCacheStore`. 0 turns the marker memo off. Cached data families
|
|
67
|
+
* (`cache()`, `"use cache"`, responses) keep reading their markers.
|
|
68
|
+
*/
|
|
69
|
+
markerFreshMs?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The oldest memoized marker a shell read still uses while a background
|
|
72
|
+
* read refreshes it; an older one blocks on the store read. Default 10000
|
|
73
|
+
* on `CFCacheStore`, 2000 on `VercelCacheStore`. The isolate that runs
|
|
74
|
+
* `updateTag()` / `revalidateTag()` writes the new marker into its memo,
|
|
75
|
+
* and the response sets the fresh-reads cookie, so the same user's next
|
|
76
|
+
* requests skip both memos on any isolate.
|
|
77
|
+
*/
|
|
78
|
+
markerMaxStaleMs?: number;
|
|
79
|
+
}
|
|
80
|
+
/** Default memo window (ms). */
|
|
81
|
+
export declare const DEFAULT_SHELL_MEMO_MS = 2000;
|
|
82
|
+
/** Default total memo size per isolate (bytes). */
|
|
83
|
+
export declare const DEFAULT_SHELL_MEMO_MAX_BYTES: number;
|
|
84
|
+
/** A store's memo options, validated. */
|
|
85
|
+
export interface ResolvedShellMemoOptions {
|
|
86
|
+
shellMs: number;
|
|
87
|
+
shellMaxBytes: number;
|
|
88
|
+
markerFreshMs: number;
|
|
89
|
+
markerMaxStaleMs: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validate a store's `memo` option; the marker memo's defaults are per store
|
|
93
|
+
* (isolate-tag-memo.ts). A non-finite value (`NaN` from `Number(env.UNSET)`,
|
|
94
|
+
* `Infinity`, null) falls back to the default, like the CFCacheStore read
|
|
95
|
+
* budgets; a finite 0 or negative passes through and turns that memo off.
|
|
96
|
+
*/
|
|
97
|
+
export declare function resolveShellMemoOptions(memo: StoreMemoOptions | undefined, markerDefaults: {
|
|
98
|
+
markerFreshMs: number;
|
|
99
|
+
markerMaxStaleMs: number;
|
|
100
|
+
}): ResolvedShellMemoOptions;
|
|
101
|
+
/**
|
|
102
|
+
* Headroom on the fresh-reads cookie's lifetime: revalidateTag() writes its
|
|
103
|
+
* markers in the background, so they can land after the response that sets
|
|
104
|
+
* the cookie, and the memos' windows count from then.
|
|
105
|
+
*/
|
|
106
|
+
export declare const FRESH_READS_MARGIN_MS = 1000;
|
|
107
|
+
/**
|
|
108
|
+
* How long the fresh-reads cookie keeps a mutating user off a store's memos:
|
|
109
|
+
* the longest either memo can still hold a value from before the mutation
|
|
110
|
+
* (the shell window; the marker memo's max-stale cap when the store reads
|
|
111
|
+
* markers through it, counted from the start of the read that filled it),
|
|
112
|
+
* plus FRESH_READS_MARGIN_MS. 0 when both memos are off: no cookie.
|
|
113
|
+
*/
|
|
114
|
+
export declare function freshReadsWindowMs(memo: ResolvedShellMemoOptions, markerMemo: boolean): number;
|
|
115
|
+
/**
|
|
116
|
+
* Whether a shell is neither stale nor expired: the only kind a memo keeps or
|
|
117
|
+
* serves (a stale read stays with the store, which schedules the recapture).
|
|
118
|
+
*/
|
|
119
|
+
export declare function isShellFresh(staleAt: number, expiresAt: number, now?: number): boolean;
|
|
120
|
+
/** Whether a shell's tags include any of `tags`. */
|
|
121
|
+
export declare function shellHasAnyTag(shellTags: readonly string[] | undefined, tags: readonly string[]): boolean;
|
|
122
|
+
export declare class ShellMemo<T> {
|
|
123
|
+
private readonly slots;
|
|
124
|
+
private totalBytes;
|
|
125
|
+
/**
|
|
126
|
+
* The value stored under `key` less than `windowMs` ago, or undefined.
|
|
127
|
+
* A hit becomes the most recently used entry.
|
|
128
|
+
*/
|
|
129
|
+
get(key: string, windowMs: number, now?: number): T | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Store `value` (`bytes` counted against `maxBytes`). Entries past their own
|
|
132
|
+
* window are dropped first, so a key that is never read again does not hold
|
|
133
|
+
* memory until the cap pushes it out; then the least recently used entries
|
|
134
|
+
* are evicted until the value fits. A value larger than the whole budget, or
|
|
135
|
+
* a window of 0, is not stored.
|
|
136
|
+
*/
|
|
137
|
+
set(key: string, value: T, bytes: number, windowMs: number, maxBytes: number, now?: number): void;
|
|
138
|
+
delete(key: string): void;
|
|
139
|
+
/** Drop every entry `predicate` selects. */
|
|
140
|
+
deleteWhere(predicate: (value: T) => boolean): void;
|
|
141
|
+
/** Bytes currently held. */
|
|
142
|
+
get size(): number;
|
|
143
|
+
clear(): void;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Tags this isolate invalidated recently, and when. `invalidateTags()` drops
|
|
147
|
+
* the isolate's memoized shells for its tags at once, but a read that was in
|
|
148
|
+
* flight (its store read done, its snapshot still arriving) can memoize one
|
|
149
|
+
* of them again while the markers or the purge are still being written. With
|
|
150
|
+
* KV that copy is harmless (every memo hit reads the markers); in KV-less
|
|
151
|
+
* purge mode the memo-hit check sees only the request's own marker memo, so
|
|
152
|
+
* nothing would reject it for a whole window, and the mutating user's next
|
|
153
|
+
* request on this isolate got the invalidated shell.
|
|
154
|
+
*
|
|
155
|
+
* A record lives from the invalidation's start until `holdMs` after it
|
|
156
|
+
* settles, which covers a read in flight when it settled (its snapshot read
|
|
157
|
+
* is bounded by the store's read budget, 170 ms by default on CFCacheStore).
|
|
158
|
+
* While it lives, a shell carrying the tag and tagged at or before the
|
|
159
|
+
* invalidation is neither memoized nor served from the memo. It only adds
|
|
160
|
+
* rejections: a shell tagged after the invalidation is not affected, and no
|
|
161
|
+
* marker read is skipped. Records are per tag across namespaces, like the
|
|
162
|
+
* memo drop in `invalidateTags()`: another namespace's shell with the same
|
|
163
|
+
* tag skips the memo for the record's life.
|
|
164
|
+
*/
|
|
165
|
+
export declare class RecentTagInvalidations {
|
|
166
|
+
private readonly records;
|
|
167
|
+
/** An invalidation of `tags` at `at` started. */
|
|
168
|
+
begin(tags: readonly string[], at: number, now?: number): void;
|
|
169
|
+
/** The invalidation begun for `tags` settled: hold its records `holdMs`. */
|
|
170
|
+
settle(tags: readonly string[], holdMs: number, now?: number): void;
|
|
171
|
+
/**
|
|
172
|
+
* Whether a shell carrying `tags`, tagged at `taggedAt`, predates a live
|
|
173
|
+
* record of one of them (a tagged shell with no tag time is treated as
|
|
174
|
+
* predating it).
|
|
175
|
+
*/
|
|
176
|
+
covers(tags: readonly string[] | undefined, taggedAt: number | undefined, now?: number): boolean;
|
|
177
|
+
clear(): void;
|
|
178
|
+
}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Capture data snapshot: recording + seeding stores for PPR shell parity.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* A PPR HIT serves frozen prelude bytes, then a Flight payload for hydration
|
|
5
|
+
* that must agree with them byte for byte. The handler layer's part of that
|
|
6
|
+
* payload is the capture's own doc segment record: the capture writes it
|
|
7
|
+
* first, renders its prelude from it, and every HIT replays it (no handler
|
|
8
|
+
* runs on a HIT). What still executes on a HIT is the loader layer: live
|
|
9
|
+
* loaders and promise-carrying bake-lane (`ssr: false`) loaders run, and the
|
|
10
|
+
* values the bake-lane ones read must match what the capture baked (a
|
|
11
|
+
* promise-free bake-lane loader is served from its pin and does not run). See docs/design/ppr-shell-resume.md.
|
|
11
12
|
*
|
|
12
|
-
* The
|
|
13
|
-
* the CAPTURE render records every cache-store read-hit and write it
|
|
14
|
-
* (the {@link RecordingShellStore}); the
|
|
15
|
-
* as its `snapshot`; on a HIT the tail render reads through a
|
|
16
|
-
* {@link SeededShellStore} overlay that serves those recorded values AS FRESH
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* were never recorded) stays live.
|
|
13
|
+
* The mechanism (Next.js resume-data-cache analog, adapted to Rango's cache
|
|
14
|
+
* rings): the CAPTURE render records every cache-store read-hit and write it
|
|
15
|
+
* performed (the {@link RecordingShellStore}); the records ride inside the
|
|
16
|
+
* ShellCacheEntry as its `snapshot`; on a HIT the tail render reads through a
|
|
17
|
+
* {@link SeededShellStore} overlay that serves those recorded values AS FRESH.
|
|
18
|
+
* Everything NOT recorded (the holes — masked loaders were never executed at
|
|
19
|
+
* capture, so their reads were never recorded) stays live.
|
|
20
20
|
*
|
|
21
|
-
* The invariant, verbatim: the snapshot is
|
|
22
|
-
* the capture
|
|
23
|
-
* content byte-identically; everything not recorded stays live.
|
|
21
|
+
* The invariant, verbatim: the snapshot is the doc record plus the cache-store
|
|
22
|
+
* reads the capture's loaders performed; replaying them on a HIT reproduces
|
|
23
|
+
* the shell content byte-identically; everything not recorded stays live.
|
|
24
|
+
* {@link pruneShellSnapshot} drops the rest.
|
|
24
25
|
*/
|
|
25
26
|
import type { SegmentCacheStore, CacheGetResult, CacheItemResult, CacheItemOptions, CachedEntryData, ShellCacheEntry, ShellSnapshotRecord, CacheReadError } from "./types.js";
|
|
26
27
|
/**
|
|
@@ -39,16 +40,26 @@ import type { SegmentCacheStore, CacheGetResult, CacheItemResult, CacheItemOptio
|
|
|
39
40
|
* — may land after the shell has quiesced. The capture collects those write
|
|
40
41
|
* promises via {@link trackWrite} and awaits them ({@link settleWrites}) before
|
|
41
42
|
* draining, so a MISS-at-capture value is still pinned.
|
|
43
|
+
*
|
|
44
|
+
* Loader attribution: every item/response access made inside a loader scope
|
|
45
|
+
* (hit, miss or write) marks its key in {@link loaderKeys}. A loader re-runs
|
|
46
|
+
* on every HIT, so those records stay pinned when the snapshot is pruned. A
|
|
47
|
+
* miss counts too: a loader that joins a handler's in-flight "use cache" call
|
|
48
|
+
* reads the store first (cache-runtime.ts) and finds nothing, and the record
|
|
49
|
+
* then comes from the handler's write.
|
|
42
50
|
*/
|
|
43
51
|
export declare class RecordingShellStore<TEnv = unknown> implements SegmentCacheStore<TEnv> {
|
|
44
52
|
private readonly inner;
|
|
45
53
|
private readonly records;
|
|
46
54
|
private readonly writes;
|
|
55
|
+
/** Record keys ({@link recordKey}) a loader read or wrote during the capture. */
|
|
56
|
+
readonly loaderKeys: Set<string>;
|
|
47
57
|
constructor(inner: SegmentCacheStore<TEnv>);
|
|
48
58
|
get defaults(): SegmentCacheStore<TEnv>["defaults"];
|
|
49
59
|
get keyGenerator(): SegmentCacheStore<TEnv>["keyGenerator"];
|
|
50
60
|
get supportsPassiveShellReads(): true | undefined;
|
|
51
61
|
private record;
|
|
62
|
+
private noteLoaderAccess;
|
|
52
63
|
/** Track a deferred cache-write promise so the capture can await it pre-drain. */
|
|
53
64
|
trackWrite(p: Promise<unknown>): void;
|
|
54
65
|
/**
|
|
@@ -67,12 +78,15 @@ export declare class RecordingShellStore<TEnv = unknown> implements SegmentCache
|
|
|
67
78
|
* cacheRoute path schedules its actual store.set in a second waitUntil while the
|
|
68
79
|
* first is running), so each awaited batch may enqueue more. Loop until the
|
|
69
80
|
* queue empties or the deadline passes. Bounded: a pathologically slow write
|
|
70
|
-
* must never stall the capture task
|
|
71
|
-
*
|
|
81
|
+
* must never stall the capture task. Resolves true when every tracked write
|
|
82
|
+
* settled, false at the deadline (settleCaptureRecord then fails the capture
|
|
83
|
+
* when the doc record is among the writes still pending).
|
|
72
84
|
*/
|
|
73
|
-
settleWrites(timeoutMs: number): Promise<
|
|
85
|
+
settleWrites(timeoutMs: number): Promise<boolean>;
|
|
74
86
|
/** The recorded snapshot (last-write-wins per family+key), or undefined if empty. */
|
|
75
87
|
drainSnapshot(): ShellSnapshotRecord[] | undefined;
|
|
88
|
+
/** One recorded value, by family and key. */
|
|
89
|
+
getRecord(family: ShellSnapshotRecord["family"], key: string): ShellSnapshotRecord["value"] | undefined;
|
|
76
90
|
get(key: string): Promise<CacheGetResult | null | CacheReadError>;
|
|
77
91
|
set(key: string, data: CachedEntryData, ttl: number, swr?: number): Promise<void>;
|
|
78
92
|
delete(key: string): Promise<boolean>;
|
|
@@ -95,6 +109,64 @@ export declare class RecordingShellStore<TEnv = unknown> implements SegmentCache
|
|
|
95
109
|
}
|
|
96
110
|
/** True iff `store` is a RecordingShellStore (duck-typed across module copies). */
|
|
97
111
|
export declare function getRecordingStore<TEnv>(store: SegmentCacheStore<TEnv> | undefined): RecordingShellStore<TEnv> | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* True when `snapshot` carries the canonical doc segment record `docKey`
|
|
114
|
+
* names, with at least one segment: the record partial replay and a
|
|
115
|
+
* fast-path HIT tail consume.
|
|
116
|
+
*/
|
|
117
|
+
export declare function hasDocRecord(snapshot: readonly ShellSnapshotRecord[] | undefined, docKey: string | undefined): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Who reads a stored snapshot besides the doc record
|
|
120
|
+
* (docs/design/shell-entry-layout.md §2):
|
|
121
|
+
* - "segments": nobody. A navigation-only entry is read only by partial
|
|
122
|
+
* replay, which seeds the doc record alone (SeededShellStore
|
|
123
|
+
* `segmentsOnly`, implicit doc scope only).
|
|
124
|
+
* - "loaders": the loaders a document HIT re-runs. Every HIT tail replays
|
|
125
|
+
* the handler layer from the doc record and never runs a handler, so the
|
|
126
|
+
* records only handler code read are dead weight.
|
|
127
|
+
*/
|
|
128
|
+
export type ShellSnapshotReaders = "segments" | "loaders";
|
|
129
|
+
/**
|
|
130
|
+
* Split a capture's snapshot into what its readers consume and the rest: the
|
|
131
|
+
* doc record (`docKey`) always; with "loaders", the loader-family records and
|
|
132
|
+
* the item/response records a loader touched during the capture
|
|
133
|
+
* (RecordingShellStore.loaderKeys). Every other segment record goes: an
|
|
134
|
+
* explicit cache() tier's reads and writes are keyed where no HIT tail and no
|
|
135
|
+
* partial replay looks (both consult only the doc record). The doc record
|
|
136
|
+
* stays a copy inside the entry: a reference to a separately stored record
|
|
137
|
+
* could be evicted on its own, and the HIT would have nothing to replay.
|
|
138
|
+
*/
|
|
139
|
+
export declare function pruneShellSnapshot(snapshot: readonly ShellSnapshotRecord[], readers: ShellSnapshotReaders, loaderKeys: ReadonlySet<string>, docKey: string): {
|
|
140
|
+
kept: ShellSnapshotRecord[];
|
|
141
|
+
pruned: ShellSnapshotRecord[];
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* The shell entry head's fields estimateShellEntryBytes does not measure
|
|
145
|
+
* (versions, timestamps, theme, lengths, flags; about 200 bytes in a
|
|
146
|
+
* CFCacheStore frame) and the frame's 12-byte prefix, with room to spare.
|
|
147
|
+
*/
|
|
148
|
+
export declare const SHELL_ENTRY_HEAD_ALLOWANCE_BYTES: number;
|
|
149
|
+
/**
|
|
150
|
+
* Bytes (UTF-8) a stored shell entry takes, as the built-in stores write it:
|
|
151
|
+
* the prelude, the snapshot's JSON, and a JSON head that carries the
|
|
152
|
+
* postponed state as an escaped string next to the tags and doc key
|
|
153
|
+
* (CFCacheStore's frame head, VercelCacheStore's envelope), plus
|
|
154
|
+
* SHELL_ENTRY_HEAD_ALLOWANCE_BYTES for the head's fixed fields and the
|
|
155
|
+
* frame prefix. Measuring the raw postponed bytes undercounted: every quote
|
|
156
|
+
* in it is escaped in the head (a /ppr-large/holes entry measured 1,098
|
|
157
|
+
* bytes under its KV value). The capture's whole-entry guard compares this
|
|
158
|
+
* with the store's value limit.
|
|
159
|
+
*/
|
|
160
|
+
export declare function estimateShellEntryBytes(parts: {
|
|
161
|
+
preludeBytes: number;
|
|
162
|
+
postponed: string | null | undefined;
|
|
163
|
+
snapshot: readonly ShellSnapshotRecord[] | undefined;
|
|
164
|
+
tags: readonly string[] | undefined;
|
|
165
|
+
docKey: string | undefined;
|
|
166
|
+
prunedRecords: string | undefined;
|
|
167
|
+
}): number;
|
|
168
|
+
/** Snapshot records by family, e.g. `segment:1/item:5` (no commas: it rides a Server-Timing desc). */
|
|
169
|
+
export declare function countSnapshotFamilies(snapshot: readonly ShellSnapshotRecord[]): string;
|
|
98
170
|
/**
|
|
99
171
|
* The store the shell fast path's IMPLICIT doc-cache scope resolves during a
|
|
100
172
|
* capture: reads pass through the recording store (a real-store hit is
|
|
@@ -137,6 +209,12 @@ export interface ShellLoaderSeedEntry {
|
|
|
137
209
|
* from the pin (loader-cache.ts pin-first path).
|
|
138
210
|
*/
|
|
139
211
|
holes: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* The record needs its loader body to run on a HIT for pushes the capture
|
|
214
|
+
* could not record (ShellSnapshotLoaderValue.runs). Only read for a
|
|
215
|
+
* hole-free record: a hole-carrying one always runs.
|
|
216
|
+
*/
|
|
217
|
+
runs: boolean;
|
|
140
218
|
}
|
|
141
219
|
export declare function buildShellLoaderSeed(snapshot: ShellSnapshotRecord[]): Promise<Map<string, ShellLoaderSeedEntry> | undefined>;
|
|
142
220
|
/**
|
|
@@ -184,3 +262,14 @@ export declare class SeededShellStore<TEnv = unknown> implements SegmentCacheSto
|
|
|
184
262
|
putShell(key: string, entry: ShellCacheEntry, ttlSeconds?: number, swrSeconds?: number, tags?: string[]): Promise<"stored" | "invalidated" | "uncacheable" | void>;
|
|
185
263
|
invalidateTags(tags: string[]): Promise<void>;
|
|
186
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Thrown by a document HIT tail's match when its doc record cannot supply the
|
|
267
|
+
* handler layer (it failed to decode, or the entry lost it). The tail must not
|
|
268
|
+
* run handlers after the prelude committed, so withCacheLookup throws this
|
|
269
|
+
* instead of resolving segments, and serveShellHit degrades the response:
|
|
270
|
+
* the entry is replaced with a tombstone, the memo is dropped, a recapture is
|
|
271
|
+
* scheduled, and the browser reloads into a MISS.
|
|
272
|
+
*/
|
|
273
|
+
export declare class ShellRecordUnavailableError extends Error {
|
|
274
|
+
constructor(docKey: string | undefined);
|
|
275
|
+
}
|
|
@@ -21,7 +21,32 @@
|
|
|
21
21
|
* primitive for each tag. A single configured store (the common case) owns its
|
|
22
22
|
* own tag index and distributed invalidation - there is no separate
|
|
23
23
|
* tag-invalidation store.
|
|
24
|
+
*
|
|
25
|
+
* Both call invalidateTags() synchronously, inside the request (#973). A store
|
|
26
|
+
* masks the tags for the rest of the request before its first await (the
|
|
27
|
+
* built-in stores write their per-request marker state there), so the request
|
|
28
|
+
* that ran either verb reads its own writes; revalidateTag() leaves only the
|
|
29
|
+
* durable remainder (KV marker put, tag purge, expireTag) to waitUntil.
|
|
30
|
+
* Invariant: the mask only turns the invalidating request's hits into misses.
|
|
31
|
+
* If the durable write then fails, that request paid extra misses, never a
|
|
32
|
+
* stale read, and other requests read the durable state. Both also record
|
|
33
|
+
* the tags on the request (markInvalidated), so a "use cache" execution or
|
|
34
|
+
* stale refresh this request started before one of its own tags was
|
|
35
|
+
* invalidated is neither joined nor written (cache-runtime.ts). Its own tags
|
|
36
|
+
* only: a nested "use cache" function's tags do not reach the enclosing
|
|
37
|
+
* entry (#980), for this gate as for eviction. Not covered (#977): such an
|
|
38
|
+
* execution in another request, or a loader cache() write, still lands, and
|
|
39
|
+
* the store accepts it (docs/design/caching.md "Read-your-own-writes").
|
|
40
|
+
*/
|
|
41
|
+
import { type RequestContext } from "../server/request-context.js";
|
|
42
|
+
/** The current position in that order; an execution records it at start. */
|
|
43
|
+
export declare function currentCacheSeq(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the request invalidated any of `tags` after `since` (a
|
|
46
|
+
* currentCacheSeq() value an execution recorded when it started): its value
|
|
47
|
+
* may predate the invalidation, so the request neither joins nor writes it.
|
|
24
48
|
*/
|
|
49
|
+
export declare function invalidatedSince(ctx: RequestContext<any, any> | undefined, tags: readonly string[] | undefined, since: number): boolean;
|
|
25
50
|
/**
|
|
26
51
|
* Immediately expire every cache entry tagged with any of `tags`, resolving
|
|
27
52
|
* once in-process invalidation across all configured stores completes.
|
|
@@ -47,10 +72,12 @@ export declare function updateTag(...tags: string[]): Promise<void>;
|
|
|
47
72
|
* This is NOT stale-while-revalidate: like updateTag() it hard-purges, so the
|
|
48
73
|
* next read after the invalidation lands is a miss that re-renders fresh. The
|
|
49
74
|
* only difference from updateTag() is awaitability - revalidateTag() defers the
|
|
50
|
-
*
|
|
75
|
+
* durable write off the response path and is not awaited.
|
|
51
76
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
77
|
+
* Read-your-own-writes (#973): each built-in store masks the tags for the rest
|
|
78
|
+
* of this request before revalidateTag() returns, so a Server Action's own
|
|
79
|
+
* re-render after it is fresh, as after `await updateTag()`. Other requests see
|
|
80
|
+
* the invalidation once the durable write lands.
|
|
54
81
|
*
|
|
55
82
|
* Fire-and-forget: because this returns void and runs in the background, a
|
|
56
83
|
* failed durable marker write (e.g. a transient KV outage) is NOT surfaced to
|