Gate the dev Cold cache badge behind an experimental flag#95169
Merged
Conversation
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.
Contributor
Tests PassedCommit: a1cdfd3 |
Contributor
Stats cancelledCommit: a1cdfd3 |
acdlite
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.coldCacheBadgeflag, plumbed to the dev overlay asprocess.env.__NEXT_EXPERIMENTAL_COLD_CACHE_BADGEvia 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 itsenvhook 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.