Skip to content

fix/perf: Do not prefetch the Changelog page when opening the nav menu - #2002

Merged
marcleblanc2 merged 1 commit into
mainfrom
marc/fix/header-changelog-prefetch
Sep 18, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
marc/fix/header-changelog-prefetch

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Problem

  • The Changelog link in the desktop header (src/components/Layout.tsx) and mobile navigation (src/components/MobileNavigation.tsx) is a next/link to https://sourcegraph.com/changelog

  • Because it is same-origin in production, Next treats it as an app route and prefetches the changelog app

  • The audit measured 61 extra requests / ~500 KB on every docs page view

Fix

Verification

  • On a preview, the Network tab should show no /changelog chunk requests after load

  • Screenshot showing prod on the left, preview on the right, when opening the left nav menu, prod has 137 requests, preview has 65

  • Broken icon in prod in another PR, coming soon

image
  • npx tsc --noEmit and pnpm run lint clean (0 errors)

Found by the docs site audit in this Amp thread; rebuilt locally in this one.

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 18, 2026 6:02am UTC

Request Review

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@marcleblanc2
marcleblanc2 marked this pull request as ready for review September 18, 2026 05:38
@marcleblanc2
marcleblanc2 requested a review from a team September 18, 2026 05:38
@marcleblanc2 marcleblanc2 changed the title fix/perf: Do not prefetch the header Changelog link fix/perf: Do not prefetch the Changelog page when opening the nav menu Sep 18, 2026
The Changelog link in the desktop header and mobile navigation was a
next/link, so every docs page prefetched the changelog route (about 61
requests and 500 KB per page view in the audit). Render it as a plain
anchor, matching the external sidebar links.

Found by the docs site audit in
https://ampcode.com/threads/T-01a0ae50-f7f0-779c-aa66-3887c9953e33

Amp-Thread-ID: https://ampcode.com/threads/T-01a0aed2-5fbe-7768-85ea-1378bf98f9ff
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 force-pushed the marc/fix/header-changelog-prefetch branch from 84697de to 6608bf2 Compare September 18, 2026 06:01
@marcleblanc2
marcleblanc2 merged commit 1e29a19 into main Sep 18, 2026
6 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/fix/header-changelog-prefetch branch September 18, 2026 06:02
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