Issue with data not reflecting on website without hard refresh in Sanity CMS.

2 replies
Last updated: Aug 30, 2023
Hi guys, whenever data is changed in my sanity CMS, it doesn't reflect on my website unless i rebuild or do a hard refresh using " Ctrl + shift + R " in chrome. A simplified version of my code can be found below please.

export default async function Home() {

`const query = groq`*[_type=="post"]`;`

const posts = await client.fetch(query);


return <Posts data={posts}/>;


}
Aug 29, 2023, 8:56 AM
If you can see the updated content only once you do a hard refresh, it looks like it is the browser that is caching the page? As such, I am not a 100% sure of this is a Sanity issue.
Aug 30, 2023, 10:19 AM
it was a next-Js issue, i fixed it thothanks alot
Aug 30, 2023, 10:20 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?