I am quite happy with any changes I make to my custom globals and collections through the admin dashboard instantly reflecting in my Nextjs website when I run it locally, but when I deploy to Firebase App Hosting, or to Vercel, via standard automatic deployments, i.e. merge work into main, the hosted website only seems to reflect content as of when the app is built. I make changes in admin, refresh the website, no changes visible. It seems to see changes, I have to trigger another deployment on Firebase or on Vercel.
This is a web app generated by the Payload website template, with Nextjs 16.2 and Payload 3.81. I'm using Vercel Neon Postgress db and storage, and all environment variables are the same for local and deployed, and all correct, because the website works fine. It just doesn't see any changes I make in admin at all. I tried including this "force dynamic" in all my server side components that do the data access via Payload, e.g:
export const dynamic = "force-dynamic";
export async function Services() {
const payload = await getPayload({ config: configPromise });
const settings: ServicesSetting = await payload.findGlobal({
slug: "services-settings",
draft: false,
});
const pagedLinks = await payload.find({
collection: "services",
depth: 1,
overrideAccess: false,
});
const services: Service[] = pagedLinks?.docs || [];
return <ServicesClient data={services} settings={settings} />;
}
I already switched away from getCachedGlobal to try and avoid these issues, but it's not just globals, but this problem is also on all my collections.