Next.js Discord

Discord Forum

Next has started preloading ALL <img /> tags

Unanswered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
We received reports from our users that the images of our cards on our browse page were loading slowly which is strange because they're usually blazingly fast and perfectly optimized.

A small bit of investigating in the network tab revealed that ALL <Link prefetch /> links preloaded ALL <img /> of that page. This caused a HUGE network bottleneck because massive images of each page were being loaded. Unsurprisingly this created a horrible user experience and downloaded gigabytes of unnecessary data.

A "fix" was to use <Image unoptimized loading="lazy" /> from next/image instead of <img />

This behavior is completely unacceptable for us. We want to prefetch the RSC of links but under no circumstances should it also preload every single image on that page.

Is there a way to opt out of image preloading for Next.js? We've been frantically scouring the docs and internet but could not find any mention of this bizarre behavior.

1 Reply

Spectacled bear
Did you try using the <Link /> without prefetch? It should still prefetch the rsc.