Hello i am using nextjs 13 server components using /app directory and sanity studio. my code looks like this
const Page = async () => {
const query = groq`*[_type == "university"]`;
const data = await sanityClient.fetch(query);
}
every time i re-deploy my site on vercel, my content loads latest updated data on the frontend. but if i change something on sanity studio and refresh my page, i only see the old changes. any help here ? thank you
Seems like you are using Next js 13 app directory. You may try this out
const Page = async () => {
const revalidate = 60 //Time interval
const query = groq`*[_type == "university"]`;
const data = await sanityClient.fetch(query, {next: {revalidate}});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With