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

Tweak expireTime document a bit more #71199

Merged
merged 2 commits into from
Oct 12, 2024
Merged

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
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