Image file size optimizations #65482
-
SummaryNext.js seems to be serving up original full sized local images with the Yes, I could resize my source image to optimize it myself, and tweak
I guess I'm not sure what "correctly sized" really means here. I have a sample codesandbox project.
Why wouldn't Next.js serve up a 602x400 scaled down/lower weight image? Is this behavior intended? Is this intentional and per-device to acommodate greater pixel-density screens? Is there a specific option needed to optimize for a smaller file size? Additional informationNo response Examplehttps://codesandbox.io/p/devbox/focused-sun-q6phl2?file=%2Fapp%2Fpage.tsx%3A11%2C34 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think I see what I'm missing here. I glossed over the documentation for I assumed that prop had more to do with responsive sizing after an image was already pulled down from the image server, but I see now it impacts what image is pulled down in the first place (emphasis mine).
The real problem here was my lack of insight with I also think my codesandbox example may be misleading, and not properly rendering images as needed. Locally, with a |
Beta Was this translation helpful? Give feedback.
I think I see what I'm missing here. I glossed over the documentation for
sizes
on the Image component, and I'm finding this prop plays a bigger role than I realized.I assumed that prop had more to do with responsive sizing after an image was already pulled down from the image server, but I see now it impacts what image is pulled down in the first place (emphasis mine).