Cache Problem with Next.js on Vercel

I got it working by changing

export const createClient = (config: prismicNext.CreateClientConfig = {}) => {
  const client = prismic.createClient(repositoryName, {
    routes,
    accessToken: process.env.PRISMIC_ACCESS_TOKEN,
    fetchOptions:
      process.env.NODE_ENV === 'production'
        ? { next: { tags: ['prismic'] }, cache: 'force-cache' }
        : { next: { revalidate: 0 } },
    ...config,
  })

to

        ? { next: { tags: ['prismic'], revalidate: 0 } }
        : { next: { revalidate: 5 } },
1 Like