Question about Nextjs revalidation…
Answered
!isColonel posted this in #help-forum
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
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.
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 ðŸ™ðŸ«¡
5 Replies
European sprat
if the SanityClient supports those options sure, but i'm guessing it does not
alternatively you can use
unstable_cache
Ill take a look. Thanks alot!
Will i figured my issue out. I didnt put these in a page but a component. Ty ðŸ™ðŸ«¡
Answer