nextjs-demo icon indicating copy to clipboard operation
nextjs-demo copied to clipboard

Add Next.js revalidation so posts update correctly

Open arcataroger opened this issue 2 years ago • 1 comments

It looks to me like the blog post wasn't getting correctly updated even after publishing & rebuilding, possibly due to the Next.js data cache.

All tests were done in new Incognito windows, with preview mode OFF.

Before

https://github.com/datocms/nextjs-demo/assets/11964962/9699903b-67a6-4267-b4fc-732a4c02ec47

After

Adding revalidate: 1 (in seconds) to our default fetchers seems to fix that for me.

image

image

arcataroger avatar Dec 19 '23 23:12 arcataroger

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nextjs-demo ✅ Ready (Inspect) Visit Preview Dec 19, 2023 11:01pm

vercel[bot] avatar Dec 19 '23 23:12 vercel[bot]