Skip to content

Navigation changes revalidate the home page - #1500

Closed
rchlfryn wants to merge 1 commit into
mainfrom
fix/nav-revalidate-home
Closed

rchlfryn wants to merge 1 commit into
mainfrom
fix/nav-revalidate-home

Conversation

@rchlfryn

@rchlfryn rchlfryn commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

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/stations showed the new menu. The home response came back x-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', matching revalidateHomePage. It runs before the nav URL lookup, so it still runs if that lookup throws.

How to test

  1. On a preview, load the home page so it's cached.
  2. Change a nav item in the admin and publish.
  3. Reload the home page: the header shows the change without waiting for the ISR window.

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.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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>
@github-actions

Copy link
Copy Markdown
Contributor

Preview deployment: https://fixxnav-revalidate-home.preview.avy-fx.org

@busbyk

busbyk commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

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.

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 revalidateTag(navigation-${tenant.slug}) in this hook already. My understanding was that doing that would cause a stale-while-revalidate behavior where the page where a fetch with that tag was made would be served stale and re-render in the background so the second page load would get a fresh page. Is that not the behavior now for the home page, blog posts, built in pages, etc.? Worth confirming before moving forward with this.

@rchlfryn

Copy link
Copy Markdown
Collaborator Author

Closing this. @busbyk was right: revalidateTag('navigation-{center}') already refreshes every page that renders the header, because Header reads the nav through unstable_cache with that tag. I tested it on this preview by publishing a DVAC nav label change. The home page, a blog post and /about-us all showed the new label on the next request, and two of those pages aren’t touched by this PR.

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.

@rchlfryn rchlfryn closed this Nov 20, 2026

This branch was previously deployed

1 inactive deployment
Preview — 6b1ffa81 Deployed Nov 11, 2026 by rchlfryn via deploy #2959
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants