superhuit-agency / superstack

Our opinionated headless WordPress boilerplate - with GraphQL, RSC, PostCSS
MIT License
24 stars 4 forks source link

Disable default NextJS link prefecth #51

Open kuuak opened 3 months ago

kuuak commented 3 months ago

next.js v14 link prefetch method will automatically prefetch all links in viewport, which could drastically load visitor network.

In a specific project we experiences more than 2.2MB downloaded for prefetch links.

Therefore we could introduce a tweak to disable default prefetch behavior and have the prefetch as Next.js v13 where links are prefetched only on hover.

see https://github.com/superhuit-agency/eca-vaud.ch/commit/0b5bee42c11afcd2da266318f9b8a76b98525dc9

What are your thoughts?