next.js
4494261b - Remove devCacheControlNoCache experimental option (hard-code no-cache) (#91503)

Commit
4 days ago
Remove devCacheControlNoCache experimental option (hard-code no-cache) (#91503) ### What? Removes the `experimental.devCacheControlNoCache` config option entirely and hard-codes `no-cache, must-revalidate` as the dev server `Cache-Control` header value. Previously the option controlled whether the dev server responded with: - `no-store, must-revalidate` (default, `false`) - `no-cache, must-revalidate` (opt-in, `true`) This PR first flips the default to `true`, then removes the option altogether — making `no-cache, must-revalidate` unconditional in all dev code paths. ### Why? `no-cache` is strictly better than `no-store` for the dev server: - `no-cache` allows the browser to revalidate (conditional `If-None-Match`/`If-Modified-Since` requests), letting the server respond with `304 Not Modified` when nothing changed → faster page loads during development. - `no-store` forces a full re-fetch every time, discarding valid cached responses. Since `no-cache` is the correct behavior for all dev users, the toggle has no remaining value and can be removed to simplify the codebase. ### How? **Two commits:** 1. `bcec825` — Flip the default from `false` → `true`; update tests/fixtures/manifest to reflect the new default. 2. `e6e919f` — Remove the option entirely: - Deleted `devCacheControlNoCache?: boolean` from `ExperimentalConfig` interface, `config-schema.ts` Zod schema, `defaultConfig`, `NextConfigRuntime`, and `getNextConfigRuntime()`. - Replaced all four conditional ternaries in `base-server.ts`, `router-server.ts`, `pages-handler.ts`, and `app-page.ts` with the hard-coded string `'no-cache, must-revalidate'`. - Deleted the `dev-cache-control-no-cache-disabled` test suite (was testing the `false` path which no longer exists). - Simplified the remaining `dev-cache-control-no-cache` test (removed experimental framing). - Synced `rspack-dev-tests-manifest.json`. --------- Co-authored-by: Tobias Koppers <sokra@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Author
Parents
Loading