Next.js Discord

Discord Forum

how can I disable all data caching across my whole app?

Unanswered
Buff-breasted Flycatcher posted this in #help-forum
Open in Discord
Buff-breasted FlycatcherOP
I don't want any fetch() calls or components that rely on server-side data to be cached.

3 Replies

@Buff-breasted Flycatcher I don't want any fetch() calls or components that rely on server-side data to be cached.
do you want to disable all caching strategies or just fetch() ?
Buff-breasted FlycatcherOP
all caching. i dont want any situation where data is stale and don't want to manually invalidate or track things since actions might affect 10-20 different DB tables & views.
then you can import fetch from node-fetch instead of using nextjs's fetch.

You can also add export const dynamic = "force-dynamic" in your root layout so that your page will always be dynamically rendered at request time.