From e083d6bf4f5b9e9a50870b6f9246a7275c9df55b Mon Sep 17 00:00:00 2001 From: Lamont Crook Date: Mon, 6 Jul 2026 15:55:10 -0600 Subject: [PATCH] Revalidate the pages tag on publish so query-index refreshes /api/revalidate now clears the `pages` tag in addition to page:. The query-index feed (cached under `pages`) drives navigation, generateStaticParams, and page metadata; publishing a new or renamed page previously didn't refresh it, so the nav mega-menu and SSG params lagged until the feed's time-based cache expired. Clearing `pages` on every publish keeps them current. Co-Authored-By: Claude Opus 4.8 --- app/api/revalidate/route.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/revalidate/route.js b/app/api/revalidate/route.js index dca04c5..157292f 100644 --- a/app/api/revalidate/route.js +++ b/app/api/revalidate/route.js @@ -29,6 +29,10 @@ export async function POST(request) { const tag = `page:${slug.replace(/^\/+|\/+$/g, '') || 'index'}`; revalidateTag(tag); + // Also refresh the query-index feed (cached under the `pages` tag). Publishing a new or + // renamed page changes the feed that drives navigation, generateStaticParams, and page + // metadata — without this they'd lag until the feed's time-based cache expires. + revalidateTag('pages'); - return NextResponse.json({ ok: true, revalidated: tag, now: Date.now() }); + return NextResponse.json({ ok: true, revalidated: [tag, 'pages'], now: Date.now() }); }