Next.js Discord

Discord Forum

Question about Nextjs revalidation…

Answered
!isColonel posted this in #help-forum
Open in Discord
Avatar
So i have a website and i use Sanity CMS for backend and fetch to client side to display in my projects page that im using NextJs for. I know there is a option in uh => https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating


Could i do something like this for fetching from Sanity with

const data = await SanityClient(query, {next: {revalidate: 3600}});
return data


Right now i just fetch, return data and use the below to tell vercel to update data but waited 3 hrs for it to update when i made a new entry and was not updating data on the page. Thanks if u can help.
export const revalidate = 60;
Answered by !isColonel
Will i figured my issue out. I didnt put these in a page but a component. Ty 🙏🫡
View full answer

5 Replies

Avatar
European sprat
if the SanityClient supports those options sure, but i'm guessing it does not
alternatively you can use unstable_cache
Avatar
Ill take a look. Thanks alot!
Avatar
Will i figured my issue out. I didnt put these in a page but a component. Ty 🙏🫡
Answer