-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix swr client inconsistencies #289
Fix swr client inconsistencies #289
Conversation
🦋 Changeset detectedLatest commit: d6a10af The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thx, I'll try this soon. My ISR is completely broken - it gets stuck w/
|
That's weird, i'm wondering if the fetch cache is not screwing things here. |
Yea, I'll try that next. Right now I'm deploying the test app through a custom domain to parity the broken one. |
The custom domain isn't the problem... |
I deleted the |
I don't understand how this could happen, but that's definitely something that we need to do. |
I added |
I undid my changes and it's working all of a sudden... nothing changed... very weird edge case which I don't know how to reproduce. |
Wait I am able to reproduce, |
I think I'm able to "fix" it... sometimes my One thing I noticed w/ this PR is that b/c |
It should not. You could try adding some log before and after calling middleware to see if the 307 is coming from the middleware. It's either caught by some other part of your middleware, or it's a bug in the middleware. Maybe we need to handle the redirects in the revalidation function
|
It was returning 307 for the initial response, then afterwards, each reload to Can we detect 307 and set it as 200? |
The only place where we could return a 307 in our code is during next-config redirect (but then it should not reach further) or inside middleware.
I don't think we could since you could decide to return a 307 from middleware. |
I see, |
Thanks, this helped me see the problem. I'm calling edit: it isn't a nextauth issue, the |
Haven't we already solved that issue ? |
We fixed a related issue with the |
I added a bunch of logs and the
I ran Maybe we can add Or maybe the proper fix is to have my middleware call |
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.
The lastModified properly works w/ the 2nd isr call now, thanks!
Not entirely sure about that, people's api route could use HEAD and may also need to go through middleware.
There is one easy fix for this one. We could use the The |
That's be great to include. |
43d82ef
to
d6a10af
Compare
@khuezy Have you tried the middleware bypass ? If it works for you, i think we're ready to release 2.3 |
Let me retest |
@conico974 it works, ship it! |
This PR aims to solve an issue regarding inconsistencies between rsc (or json) data and html data for ISR.
Until now next set the
cache-control
header tos-maxage=X, stale-while-revalidate
withX
being the revalidate value.This cause inconsistencies between rsc and html data due to cdn caching especially for big revalidate value.
For example with
revalidate=3600
, rsc and html could be out of sync by a maximum of 3599 seconds. It is assuming someone accessed the html att=0
and no one accessed the rsc untilt=3599
.This behaviour is exacerbated with app dir since every
<Link />
pointing to the same route from a different route will result in a different rsc call and thus a different cdn cache entry.This PR also fix the 5 min deduplication window of the SQS queue.