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

Add note about skipping upstream cache during revalidation #38014

Merged
merged 4 commits into from
Jun 25, 2022

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jun 25, 2022

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

  • Make sure the linting passes by running pnpm lint
  • The examples guidelines are followed from our contributing doc

Fixes: #35523 (comment)
x-ref: #35195

…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.
Copy link
Member

Choose a reason for hiding this comment

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

Slightly modified - thoughts?

Copy link
Member Author

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

Copy link
Member Author

@ijjk ijjk Jun 25, 2022

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?

@ijjk ijjk requested review from leerob and styfle June 25, 2022 16:18
@kodiakhq kodiakhq bot merged commit a148d14 into vercel:canary Jun 25, 2022
@ijjk ijjk deleted the docs/on-demand branch June 25, 2022 16:29
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On-demand ISR do not work correctly
3 participants