Next.js caching

Hey guys, I'm having a hard time understading what is wrong here. I made a simple repo: https://github.com/HellYeahOmg/revalidate-test Main page has a get request for some items, the second page has a form to add items. After submitting the form i expect to see the updated result on the main page. I added every disabling cache option i could, but it still doesnt work unless i hit router.request() or revalidatePath(). Why so?
GitHub
GitHub - HellYeahOmg/revalidate-test
Contribute to HellYeahOmg/revalidate-test development by creating an account on GitHub.
8 Replies
Neto
Neto4mo ago
you should try opting out of the cache for the fetch
hellyeah
hellyeah4mo ago
@nyx (Rustular DevRel) i of course tried, but my mistake i didnt commit it updated the repo, main page has export const dynamic = 'force-dynamic' export const revalidate = 0 and the get request also has cache: 'no-store' policy
Neto
Neto4mo ago
caching on nextjs sucks but to bust the cache you need to revalidatePath() from itself or from a server action
hellyeah
hellyeah4mo ago
tho it works for that particular simple case, it doesn't work with the case im facing in prod rn https://github.com/HellYeahOmg/revalidate-test/tree/long-async-request While sending a heavy request from the main page, users can navigate to other pages, and in that case even revalidatePath (or revalidateTags) doesnt help...
GitHub
GitHub - HellYeahOmg/revalidate-test at long-async-request
Contribute to HellYeahOmg/revalidate-test development by creating an account on GitHub.
hellyeah
hellyeah4mo ago
i wonder what all those setting do if they dont help
Neto
Neto4mo ago
¯\_(ツ)_/¯
Ricardo
Ricardo4mo ago
i'll try yo help u bro
Want results from more Discord servers?
Add your server