Next.js Discord

Discord Forum

Next.js cacheComponents + <Link> ignores the static build cache on first navigation

Unanswered
German Shorthaired Pointer posted this in #help-forum
Open in Discord
German Shorthaired PointerOP
I've been banging my head against this for days and can't find a single clear answer online... not on the Next.js docs, not from ChatGPT, not from Google. Posting here again as I didn't get an answer previously.

---

## My setup

- Next.js 16 with cacheComponents: true (PPR enabled)
- Vercel deployment
- Supabase as database
- use cache with cacheLife("max") and cacheTag("tools") on all data fetching functions
- Pages come out as Static or Partial Prerender after npm run build

## The problem

After npm run build, my pages are fully prerendered or static. When I navigate to one of them for the first time using Next.js <Link>, I can see a cache MISS log fire in my server console — meaning it's completely ignoring the prerendered static build, spinning up a new server-side execution, and hitting Supabase fresh. Subsequent navigations to the same page are fine, but that first hit always misses.

## The insane part

When I replace <Link> with a plain <a> tag, the page loads instantly with zero server calls and zero Supabase hits. The prerendered HTML is served directly from Vercel's CDN, exactly as it should be. So <a> is simultaneously faster, cheaper, and actually respects the build cache — while <Link>, the officially recommended approach, bypasses all of it.

## My question

Why does <Link> with cacheComponents: true maintain a completely separate cache from the static build output? These pages are Static — fully rendered at build time — so why does client-side navigation re-execute the component on the server instead of serving the prerendered page?

And practically: why would I ever prefer <Link> over <a>if it only makes it slower by not taking the build pages into consideration?

0 Replies