Nghĩa dev
Nghĩa dev
TTCTheo's Typesafe Cult
Created by Nghĩa dev on 7/8/2024 in #questions
Serverless function runs right after edge middleware is invoked, overriding built-time data
No description
11 replies
TTCTheo's Typesafe Cult
Created by Nghĩa dev on 5/25/2024 in #questions
How to revalidate the data cache on deployment
I'm building my SSG website with Sanity headless cms and have set up webhook to trigger a redeployment on new content being published so it would generate a new pages with updated content. The problem: When I leave the fetch request by default, the data is cached across deployments so it would use the data from the last deployment instead of the newly updated data. So I added cache: no-store to the fetch option but that made it so that the page become dynamic and would fetch the new data before it's ready for production and erroring out, moreover I'd like the pages to be SSG so that's wouldn't help. What I've tried: I've been crawling through this guide https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config but most of it just essentially impose 1 caching strategy on every fetch request on a layout or page Thanks in advance
3 replies