Skip to content
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

Set default stale-while-revalidate header value to 1 year #65867

Merged
merged 1 commit into from
May 16, 2024

Conversation

flybayer
Copy link
Contributor

This follows 2 previous PRs, #52251 and #61330 by making a 1 year expiry the default for the stale-while-revalidate header.

As far as I can tell, the current default is invalid according to RFC 5861.

Any user deploying Next.js behind any CDN other Vercel expects SWR to work correctly, but it does not because there is no default expiry value.

This change will make the default work for all Next.js users and greatly reduce frustration for those of us deploying Next.js places besides Vercel.

This also fixes a small edge case where experimental.swrDelta = 0 would not function as expected.

Thank you!

@ijjk
Copy link
Member

ijjk commented May 16, 2024

Allow CI Workflow Run

  • approve CI run for commit: 8c27b9c

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@feedthejim feedthejim merged commit a753a39 into vercel:canary May 16, 2024
27 of 33 checks passed
ztanner added a commit that referenced this pull request May 17, 2024
ztanner added a commit that referenced this pull request May 17, 2024
…65887)

This PR was run without CI. Reverting so we can reland after it passes
CI.

Reverts #65867
panteliselef pushed a commit to panteliselef/next.js that referenced this pull request May 20, 2024
@ijjk ijjk mentioned this pull request May 23, 2024
ijjk added a commit that referenced this pull request May 23, 2024
Alternative to #65867 this
stabilizes our `swrDelta` config that allows customizing the
`stale-while-revalidate` period that is included in the `Cache-Control`
header for ISR enabled routes.

This is not a breaking change itself as no default value is provided as
is the case already.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants