Clarify 'use cache' coordination and fix cache sharing
The wrapper separates invocation preparation, Resume Data Cache reads, cache handler lookups, generation, and cache entry consumption. The foreground and background paths express reuse and lookup retries directly. Pending and completed invocations have separate types, and their state updates show which cache handler lookup and result they replace. Intra-request deduplication shares cache handler lookups and generated entries within a `WorkStore`. Cross-request generation deduplication shares only pending generation and its cache handler writes. Each `WorkStore` validates handler entries with its own implicit tags, so a concurrent request cannot bypass path revalidation by joining another handler lookup. Each invocation applies cache-life rules and propagates metadata to its own outer scope. A direct prerender invocation can omit a short-lived entry while a nested cache consumes it. Separate prerenders create their own hanging promises when they omit handler entries. The Resume Data Cache records the omission for later render phases. The downstack tests extend PR #100652 and characterize the sharing bugs. This change updates their expectations for independent handler lookups and per-invocation rendering decisions. Background revalidation preserves the Resume Data Cache consistency behavior from PR #100447, and the stream error and cancellation handling from PR #100673 remains intact.
Showing
This diff is collapsed.
Please
register
or
sign in
to comment