Next.js Discord

Discord Forum

Why is ISR taking 2 refreshes to properly fetch new data on each page?

Answered
Swyftey posted this in #help-forum
Open in Discord
Hi,

I have next: { revalidate: 5 } set on my API fetches, but for some reason I still have to refresh a second time to view the new/changed data even after it's been logner than 5 seconds. This happens on each page where data is being fetched on the server side (each page needs to be refreshed a second time).

What seems to be happening and how can I fix it?

Just to clarify: In the video, I delete a document which I think its card should have been removed after the first refresh because the cache should be stale

Thanks for any help.
Answered by Swyftey
I got my answer, for now anyways.

To anyone who may ever come across this post:

I'm using unstable_cache to make sure I only have to reload once.
View full answer

8 Replies

Is there a way to make it one refresh (while using revalidate/ISR)? I do not recall needing to refresh twice in some earlier version of my code.
you may bump but please keep it to once a day only, thanks. your post is not even 3 hours old
yes, i was referring to you bumping once. it's not a hard rule, but it's pretty clear implicitly that you shouldn't bump unless a significant amount of time has passed, not 41 minutes. bumping then deleting makes it no less fishy because that's a common tactic used here to circumvent the bump rule – we know it when yall do that.
we do have a message logger sir
sooo... you're the fishy one
every message logged, that's nuts and imo sounds against TOS in a way - not sure tho
I got my answer, for now anyways.

To anyone who may ever come across this post:

I'm using unstable_cache to make sure I only have to reload once.
Answer