Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> How can smart preloading work when the image size isn't known until the JS component runs?

From the article:

- Image dimensions are enforced, allowing browsers to immediately render the space needed for the image instead of having it jump in when loaded, preventing layout shift.

- While width and height on the HTML <img> element can cause issues with responsive layouts, this is not the case when using next/image. When using next/image the image is automatically made responsive based on the aspect ratio from the provided width and height.



Image dimensions is great, but isn't the same as preloading, which is done via a HTTP header or a <link rel=preload>

See https://web.dev/preload-critical-assets/ for more details.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: