Next.js Discord

Discord Forum

Link preload in nextjs app router

Unanswered
Dwarf Crocodile posted this in #help-forum
Open in Discord
Avatar
Dwarf CrocodileOP
is it possible to do this in

<link
    rel="preload"
    href="/path/to/image.ext"
    as="image"
  />


using the export metadta in the approuter? I can't find any references to preload when looking in the types or the docs

3 Replies

Avatar
Toyger
links prefetched by default when became visible, you can read more here https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching
Avatar
Asian paper wasp
If what you want is to preload a high-priority image, you could just use <Image priority />
https://nextjs.org/docs/app/api-reference/components/image#priority
Avatar
Dwarf CrocodileOP
Its a css background image that’s my problem