Hey there, new to Payload and never used NextJS for anything crazy, but I am trying to use the next-payload utility to integrate payload with a new nextJS app (just a small business site for a new company) and am having trouble figuring out how to revalidate pages and a global header so the updated content in the CMS shows in the frontend after deploying things to Vercel.
I've been able to output pages and the nav items from the global header in the frontend, but after updating content in the CMS and saving and visiting the frontend, the old content shows. This is due to the pages being statically generated when deployed to Vercel, but how would I go about setting up revalidation so the updates show in the frontend? I've looked at the payload website template code that's output after using create-payload-app, and I'm seeing a src/app/api/revalidate file which seems to handle things for the website template, but I'm not seeing any revalidate code on the nextjs side via next-payload even though there is src/pages/api code that next-payload adds.
Also, I'm using the local API in the app folder to display the initial content that shows before updates in the CMS are made. Is this right? Should I be using fetch instead in order for revalidate to work? Happy to provide any code needed!
I think all you would need to do is add this file to api folder. We could also add this to the plug-in so it is there by default - if you want to open an issue under this repo that would be great
I got this to work by not using local API and using fetch with tags: