Skip to content

docs: Incremental cache is not used for cache-control: no-cache requests #80352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

icyJoseph
Copy link
Contributor

Closes: #80346

  • if (entry) {
    await handleUnlock()
    } else {
    // in dev, incremental cache response will be null in case the browser adds `cache-control: no-cache` in the request headers
    cacheReasonOverride = 'cache-control: no-cache (hard refresh)'
    }
  • // we don't leverage the prerender cache in dev mode
    // so that getStaticProps is always called for easier debugging
    if (
    this.disableForTestmode ||
    (this.dev &&
    (ctx.kind !== IncrementalCacheKind.FETCH ||
    this.requestHeaders['cache-control'] === 'no-cache'))
    ) {
    return null
    }

@icyJoseph icyJoseph self-assigned this Jun 10, 2025
@ijjk ijjk added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Jun 10, 2025
@icyJoseph icyJoseph merged commit e74a824 into canary Jun 10, 2025
70 checks passed
@icyJoseph icyJoseph deleted the docs/fetch-cache-hard-refresh-in-dev-mode branch June 10, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: fetch Data Cache , in the development environment is always revalidated
3 participants