Next.js Discord

Discord Forum

Disable next page caching for a specific page

Unanswered
Spectacled Caiman posted this in #help-forum
Open in Discord
Spectacled CaimanOP
I have a page.tsx that calls drizzle db.select(), and I want this page to send a call to the db everytime it is visited. So, if i go to that page, press a Link to another page, then go back to the first page I want the db.select to be called again, instead of the current behaviour which uses the old cached page.

14 Replies

Spectacled CaimanOP
I tried export const revalidate = 5 and it didn't revalidate after 5 seconds
although i'm not sure if revalidate is what you're pointing at
dynamic not revalidate
Spectacled CaimanOP
so export const dynamic = "force-dynamic"?
Spectacled CaimanOP
This didn't actually work btw
is it because i'm using drizzle and not a fetch request
What i mean is specifically for navigating back forth on browser
and how it caches that
the page itself can cache in addition to the fetch request
all of the options are on the link i sent.
set them and see what happens till you get the results you want.