Next.js Discord

Discord Forum

How to revalidate my data?

Unanswered
British Shorthair posted this in #help-forum
Open in Discord
British ShorthairOP
Hey all, reading a bit about how nextjs handles fetching and caching.
In my app which uses the latest version of nextjs I have some data consisting of phrases with each phrase having its own like and dislike counter or whatever you wanna call it.

Initially I noticed that fetch will always cache by default so at least in my app the data remained the same in the front no matter what changes I did in the backend. According to the docs adding ', { cache: 'no-store' }' to my fetch will not store and cache this data so now when listing my data everything is updated. But when I want to route to a specific page's expanded view then again I see the old values. I guess this is a use case for Route Handles?

0 Replies