Skip to content

Skip revalidation for RSC fallback data by default#4119

Open
dcondrey wants to merge 6 commits intovercel:mainfrom
dcondrey:dcondrey-patch-1
Open

Skip revalidation for RSC fallback data by default#4119
dcondrey wants to merge 6 commits intovercel:mainfrom
dcondrey:dcondrey-patch-1

Conversation

@dcondrey
Copy link

Add configuration option revalidateOnRSCFallback (default: false) to eliminate redundant network request since data is already fresh when using SWR with RSC.

Changes

  • Added configuration option revalidateOnRSCFallback to PublicConfiguration
  • Updated revalidation logic to detect fallback data from RSC context
  • Set default value to false
  • Added test

Related Issues

Fixes #4065

@dcondrey dcondrey requested review from huozhi and shuding as code owners April 17, 2025 10:53
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 17, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

dcondrey added 5 commits March 7, 2026 19:36
Add configuration option to skip revalidation when data comes from RSC fallback
For data coming from RSC fallback, respect revalidateOnRSCFallback option
Add revalidateOnRSCFallback default value
Create a test file to verify revalidateOnRSCFallback
Prevent the RSC fallback check from catching all fallback data.
The option now only takes effect when explicitly set, preserving
existing revalidation behavior for non-RSC use cases.
Add the revalidateOnRSCFallback guard to getSnapshot's shouldStartRequest
so isValidating/isLoading correctly report false when revalidation is
skipped. Add tests for backwards compatibility and SWRConfig provider
fallback.
@dcondrey
Copy link
Author

dcondrey commented Mar 8, 2026

@shuding @huozhi review requested

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.

Feature request: when RSC data fetching set as the fallback, skip onmount revalidation

1 participant