-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Add note about skipping upstream cache during revalidation #38014
Conversation
docs/basic-features/data-fetching/incremental-static-regeneration.md
Outdated
Show resolved
Hide resolved
…ion.md Co-authored-by: Steven <steven@ceriously.com>
@@ -88,6 +88,8 @@ When a request is made to a page that was pre-rendered at build time, it will in | |||
|
|||
When a request is made to a path that hasn’t been generated, Next.js will server-render the page on the first request. Future requests will serve the static file from the cache. ISR on Vercel [persists the cache globally and handles rollbacks](https://vercel.com/docs/concepts/next.js/incremental-static-regeneration). | |||
|
|||
> Note: Check if your upstream data provider has caching enabled by default. You might need to disable (e.g. `useCdn: false`), otherwise a revalidation won't be able to pull fresh data to update the Next.js cache. When using Next.js on Vercel, caching is enabled by default through the Vercel Edge Network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly modified - thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using Next.js on Vercel, caching is enabled by default through the Vercel Edge Network
Is this referring to API routes, as caching isn't enabled by default there unless the cache-control
header is set. Also not sure how common it is to fetch from a Vercel endpoint during a revalidation instead of database or CMS like Contentful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tweaked a bit more in bead242 wdyt?
This adds a note about ensuring requests during a revalidation don't leverage an upstream cache as it will fail to pull fresh data to update the ISR cache with if configured.
Documentation / Examples
pnpm lint
Fixes: #35523 (comment)
x-ref: #35195