-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
ISR on-demand need reload page on deployment with Vercel #39186
Comments
Hi, this is due to the client side caching we do when prefetching page data, in the latest version of Next.js we will automatically attempt updating this cache on hover but this is best effort so if the request isn't returned before click we use the existing cache data to ensure a fast/successful navigation. To skip using the client cache on a client navigation you can use |
Hi, I am using Does When I use prefetch |
Is any idea? NextJs is my favorite framework, but please take one more step to fully work ISR on demand |
Can you provide a more specific reproduction? It sounds like a race condition is occurring in the way the project is creating and then revalidating. Ideally some time is given to allow the revalidation to occur and propagate before attempting to fetch the fresh data on the client. |
@ijjk That's right, you should allow time for revalidation, even if the revalidation status comes 200 and after it immediately make a push to the page that was revalidated
|
Yeah the above snippet is racing the cache getting updated on the edge with the new request for data on the client as it isn't going to be immediately available. Also it looks like the I'm gonna close this for now as it doesn't appear to be a bug but we are going to continue to investigate handling for optimistically updating the cache on the client when the edge cache has changed. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which example does this report relate to?
ISR on-demand
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
npm run build
Describe the Bug
When using on-demand ISR deployed on Vercel with client routing (Link from next/link or
router.prefetch with router.push), you need to navigate twice to the page that was revalidated or do a full page reload to see the actual data.
Expected Behavior
When you go to a page that has been revalidated, get the actual data at once
To Reproduce
You are on the document creation page, after you create a document you do revalidate the document list, after a successful response you click on the button (whether it is Link from next/link or router.prefetch then router.push ) which links to the document list, but the document list is not updated, to get a new list you have to either do a reload or go to another page and go back to the document list page again. This only happens when deploying with Vercel and using npm run build && npm same problem (But sometimes it's working normal)
The text was updated successfully, but these errors were encountered: