Next.js Discord

Discord Forum

Question about caching

Unanswered
gin posted this in #help-forum
Open in Discord
ginOP
fetch('https://...', { next: { revalidate: 3600 } })


This will append the revalidate data to the cached content and nextjs will only refetch when it expires right?
So that means i dont have to use
{ cache: 'force-cache' })

5 Replies

ginOP
and is that cache available globally and reused for every connection?
and what happens if i for example use
revalidatePath("/", "layout");


This will refetch the data and ignore the revalidate right?
@gin and is that cache available globally and reused for every connection?
ginOP
what for example we dont append any identifier in the fetch request and the external backend only uses the request headers automatically appended to return customized content
how would nextjs know to cache those requests and show it correctly to the right user
i want to fetch something that is extremely rate limited but also depends on identifiers but im also using revalidatePath and i dont want to trigger a refetch everytime revalidatePath is used