Next.js Discord

Discord Forum

revalidatePath working only if we trigger several times

Unanswered
Channel catfish posted this in #help-forum
Open in Discord
Channel catfishOP
Hi team we are using Prismic CMS, and we build a webhook integration to revalidate the main layout everytime we change something on the CMS, but it only works if we trigger the webkook more the three times, we are not sure if we are missing something, the workaround we have for now is to trigger a comple new build but it takes couple of mins, so it is not optimize, we would love to get the on demand revalidation working.


import { revalidatePath } from 'next/cache';

import { NextResponse } from 'next/server';

export async function GET() {
  revalidatePath('/', 'layout');

  return NextResponse.json({ revalidated: true, now: Date.now() });
}

Our libs version, node 20
`
"next": "^14.2.2",
"@prismicio/client": "^7.3.1",
"@prismicio/helpers": "^2.3.8",
"@prismicio/next": "^1.5.0",
"@prismicio/react": "^2.5.1",
`

0 Replies