Skip to content

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Oct 12, 2024

Follow-up to #71159 this tweaks the docs to explain the new behavior a bit more and re-word some parts.

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation. labels Oct 12, 2024
@ijjk ijjk requested review from sebmarkbage and ztanner October 12, 2024 17:41
Now instead of the default of 1 year `stale-while-revalidate` period being provided in the `Cache-Control` header, the custom period will be included.
Now when sending the `Cache-Control` header the expire time will be calculated depending on the specific revalidate period.

For example, if you have a revalidate of 30 seconds on a path and the expire time is 31536000 seconds the generated `Cache-Control` header will be `s-maxage=30, stale-while-revalidate=31535970` so that it can stay stale for 30 seconds less than the configured expire time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having two numbers so far apart doesn't really show the difference since who cares?

Maybe an example of 15 minutes and expire in 60 minutes shows it better?

@ijjk ijjk enabled auto-merge (squash) October 12, 2024 20:04
@ijjk ijjk merged commit 9d376c6 into vercel:canary Oct 12, 2024
38 checks passed
@ijjk ijjk deleted the ijjk/expire-time-doc branch October 12, 2024 20:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants