Skip to content

[PPF] Model caches with stale < MIN_SHELL_STALE as prefetch-only data - #98339

Open
lubieowoce wants to merge 3 commits into
lubieowoce/fix-runtime-followupfrom
lubieowoce/short-stale-is-not-runtime
Open

[PPF] Model caches with stale < MIN_SHELL_STALE as prefetch-only data#98339
lubieowoce wants to merge 3 commits into
lubieowoce/fix-runtime-followupfrom
lubieowoce/short-stale-is-not-runtime

Conversation

@lubieowoce

@lubieowoce lubieowoce commented Sep 8, 2026

Copy link
Copy Markdown
Member

Caches that have stale < MIN_SHELL_STALE were using makeStageHangingPromise in prerenders, which (in theory) was meant to track a runtime data access during a static prerender, which in turn would make the page use runtime shells. This is semantically incorrect, because both static and runtime shells would exclude the cache, and both static and runtime prefetches would include it, so it does not actually signal runtimeness, only prefetchness. The only thing we should be doing for these caches is excluding the content, same as unstable_prefetch().

This PR replaces makeStageHangingPromise with makePrefetchHangingPromise, which is not tracked as runtime data at all. We also use it for unstable_prefetch() to signal the correspondence.

Note that in practice, the usage of makeStageHangingPromise in use-cache-wrapper was technically fine, because its runtime data tracking was effectively dead code. We only returned it if stagedRendering.finalStage < stage, but for static prerenders stage = staticLinkDataStage = PrefetchStatic and finalStage = Static, so the condition was never actually true, and we never actually tracked it as a runtime data access. However semantically it should still not be tracked as runtime data.
(The condition can be true in a runtime prerender that only prerenders the shell. We don't do any tracking in runtime prerenders, so it was also a no-op).


Stack created with GitHub Stacks CLIGive Feedback 💬

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: d5f8ee9

Note that in practice, the usage of `makeStageHangingPromise` was fine,
because `stagedRendering.finalStage < stage` was never true in static
prerenders, so we never actually tracked it as a runtime data access.
However semantically it should never be tracked as runtime data, because
a runtime shell would not provide it either.
@lubieowoce
lubieowoce force-pushed the lubieowoce/short-stale-is-not-runtime branch from 550b73c to d5f8ee9 Compare September 8, 2026 02:24
@lubieowoce lubieowoce changed the title [PPF] model stale < MIN_SHELL_STALE as prefetch-only data (not runtime data) [PPF] Model caches with stale < MIN_SHELL_STALE as prefetch-only data Sep 8, 2026
@lubieowoce
lubieowoce marked this pull request as ready for review September 8, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant