Next.js Discord

Discord Forum

ISR Function endpoint always cached

Answered
American Staffordshire Terrier posted this in #help-forum
Open in Discord
American Staffordshire TerrierOP
I have this endpoint and it seems that it is always cached even if I add no-store and export const fetchCache = 'force-no-store' to the route.ts file.
Answered by joulev
export const revalidate = 0
View full answer

6 Replies

Answer
@joulev export const revalidate = 0
American Staffordshire TerrierOP
Should I remove from route.ts?

export const fetchCache = 'force-no-store'

cache: 'no-store',
next: { revalidate: 10 }
@American Staffordshire Terrier Should I remove from route.ts? js export const fetchCache = 'force-no-store' cache: 'no-store', next: { revalidate: 10 }
Hmm what do you actually want? The endpoint always fetching fresh data, or the endpoint being static?
@joulev Hmm what do you actually want? The endpoint always fetching fresh data, or the endpoint being static?
American Staffordshire TerrierOP
Always fetching and returning fresh data.
Yes then remove those things
American Staffordshire TerrierOP
Thanks, that worked!