Next.js Discord

Discord Forum

Stale data

Unanswered
Pacific sand lance posted this in #help-forum
Open in Discord
Pacific sand lanceOP
why does on development, the data displays in real time compared to build when the data stales and just displays the first data and don't update it when a new data is created?

5 Replies

it's because in production mode, the page is static by default
@Ray you can make it dynamic by https://nextjs.org/docs/app/building-your-application/caching#opting-out-1
Pacific sand lanceOP
this means i just need to add
cache:'no store'
to my fetch?
@Ray you can make it dynamic by https://nextjs.org/docs/app/building-your-application/caching#opting-out-1
Pacific sand lanceOP
i've done this, my api 304 code is now 200, but the data is still displaying outdated ones compared to dev mode
Siberian Flycatcher
Hi. Could you show some code for the component that does the fetching and mutations.