Skip to content

Gate the dev Cold cache badge behind an experimental flag#95169

Merged
unstubbable merged 1 commit into
canaryfrom
hl/flag-cold-cache-badge
Jun 25, 2026
Merged

Gate the dev Cold cache badge behind an experimental flag#95169
unstubbable merged 1 commit into
canaryfrom
hl/flag-cold-cache-badge

Conversation

@unstubbable

Copy link
Copy Markdown
Contributor

The cold cache dev indicator added in #94611 surfaces a load that filled an empty cache while streaming. After the load settles it leaves a persistent "Cold cache" badge in the corner. That badge is visually too loud and disruptive in its current form, so we want to keep iterating on its UI and UX before showing it to everyone. Until then it should be off by default.

This change puts that persistent badge behind a new, default-off experimental.coldCacheBadge flag, plumbed to the dev overlay as process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE via the define plugin. The transient "Rendering (cold cache)" pill shown during a navigation is intentionally kept regardless of the flag: it is transient and clears itself once the blocking navigation transition has committed, so it stays valuable without being disruptive. Only the permanent badge was the problem. The pre-existing "Cache disabled" (bypass) badge and the DevTools menu's cold-cache entry are also unaffected.

The gate lives in computeIntent, so when the flag is off a cold load resolves to no badge and the indicator follows its existing empty-badge render path. Storybook forces the flag on through its env hook so the badge stories remain the surface for iterating on the design, and every test suite that asserts on the badge opts into the flag so none of them regress while it is disabled by default.

The cold cache dev indicator added in #94611 surfaces a load that filled
an empty cache while streaming. After the load settles it leaves a
persistent "Cold cache" badge in the corner. That badge is visually too
loud and disruptive in its current form, so we want to keep iterating on
its UI and UX before showing it to everyone. Until then it should be off
by default.

This change puts that persistent badge behind a new, default-off
`experimental.coldCacheBadge` flag, plumbed to the dev overlay as
`process.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGE` via the define
plugin. The transient "Rendering (cold cache)" pill shown during a
navigation is intentionally kept regardless of the flag: it is transient
and clears itself once the blocking navigation transition has committed,
so it stays valuable without being disruptive. Only the permanent badge
was the problem. The pre-existing "Cache disabled" (bypass) badge and
the DevTools menu's cold-cache entry are also unaffected.

The gate lives in `computeIntent`, so when the flag is off a cold load
resolves to no badge and the indicator follows its existing empty-badge
render path. Storybook forces the flag on through its `env` hook so the
badge stories remain the surface for iterating on the design, and every
test suite that asserts on the badge opts into the flag so none of them
regress while it is disabled by default.
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: a1cdfd3

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Stats cancelled

Commit: a1cdfd3
View workflow run

@unstubbable unstubbable marked this pull request as ready for review June 25, 2026 17:52
@unstubbable unstubbable merged commit 9da1544 into canary Jun 25, 2026
226 of 229 checks passed
@unstubbable unstubbable deleted the hl/flag-cold-cache-badge branch June 25, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants