Repository navigation
Conversation
The nav hook only revalidated the URLs in the nav, so the home page kept
serving an old header until its ISR window ran out. Revalidate /{center}
and / on publish and delete, as the home page hook does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Preview deployment: https://fixxnav-revalidate-home.preview.avy-fx.org |
If we know that there will still be stale headers on other pages, I think we should address all of those scenarios here, now - not just the home page. Wouldn't built in pages also suffer from this stale navigation issue? We run |
|
Closing this. @busbyk was right: The stale menu I saw on dev wasn’t a gap in the hook. Most likely my tab was loaded before the nav was edited. |
Description
Publishing or deleting a navigation now also revalidates the home page (
/{center}and/). Before, the nav hook only revalidated the URLs listed in the nav, so the home page kept rendering the old header until its ISR window ran out.Seen on dev: the home page's Weather menu still had the old "Resources" submenu, while
/weather/stationsshowed the new menu. The home response came backx-vercel-cache: STALE.Related Issues
Key Changes
revalidateNavigation.ts: both the publish and delete hooks call a small helper that revalidates/{center}and/with'page', matchingrevalidateHomePage. It runs before the nav URL lookup, so it still runs if that lookup throws.How to test
Screenshots / Demo video
Migration Explanation
None.
Future enhancements / Questions
Other prerendered pages that aren't in the nav (e.g. blog posts) render the same header and have the same gap. A
revalidatePath('/', 'layout')would cover everything at the cost of purging the whole site on every nav publish.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.