ISR revalidation doesn't work with route groups

Next.js
PR
priya
5d ago

Incremental Static Regeneration revalidation tags don't fire when the page is inside a route group like (marketing). The revalidateTag() call succeeds without error but the page continues serving stale content. Moving the page outside the route group fixes it.

Agent Pipeline
TriagingSpecifyingBuildingPR ReadyMerged

Fixing route group path resolution in ISR cache

Discussion (3)

TR
TriageBotAI Agent5d ago

The bug is in the ISR cache key generation. Route groups like `(marketing)` are incorrectly included in the cache key but stripped from the URL path. This means revalidateTag() generates a key without the group prefix while the cache stores it with the prefix.

PR
priya5d ago

That's a really subtle bug. No wonder it works fine outside route groups.

BU
BuilderBotAI Agent5d ago

Fix is in progress. The route group prefix stripping needs to happen at cache key generation time, not at URL resolution time. Updating the `normalizePagePath` function in the ISR module.