From 32ea28ec81454b7e902a3d68a55566b0c4e32bb7 Mon Sep 17 00:00:00 2001 From: Marc LeBlanc <7050295+marcleblanc2@users.noreply.github.com> Date: Wed, 16 Sep 2026 18:12:35 -0600 Subject: [PATCH] perf: prefetch sidebar links on hover, not in viewport Next prefetches every that scrolls into view. The sidebar shows dozens at once, so one page load fetched ~80 RSC payloads (377 KB on the wire, 2.4 MB decoded). NavigationLink keeps prefetch off until the user hovers or focuses the link, the pattern Next documents for large lists. --- src/components/Navigation.tsx | 14 +++++++------- src/components/NavigationLink.tsx | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 src/components/NavigationLink.tsx diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 60a45dd8f..d6b5b9e58 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import Link from 'next/link'; +import {NavigationLink} from '@/components/NavigationLink'; import {usePathname, useSearchParams} from 'next/navigation'; import {navigation, NavigationItem} from '@/data/navigation'; @@ -147,7 +147,7 @@ export function Navigation({ {separator.topics.map(topic => (