NextJS
Image Component
Downsides:
Comment by TheThirdRace on Youtube:
"Great video, but it would have been nice to also provide the downsides of using Next/Image component:
It doesn't remove network requests, it simply use the etag no matter what (which is still lower than retrieving the whole image, but still a network request)
You can't override cache in request Header, so the cache is managed however NextJs decided it will be, even if your image will never change in the next 100 years
It uses inline-styles, which are completely screwing up your Content-Security-Policy
The inline-styles touch things they shouldn't like margins, padding, borders. By their nature of being inline, you can't override them unless you use the dreaded !important and very flimsy css selectors. All this makes some simple layouts a huge gymnastic.
It uses multiple wrappers to achieve the layout, which is unnecessary since you could use background-image on the img tag for the placeholder and css (not inline) for the sizing. This considerably increase the number of DOM nodes used when you have multiple images in your page
The wrappers are div tags, which means you can't use an image in an inline tag like the P tag. Not a huge problem, but for those that hate to see a big red message in the console, it's a bit frustrating..."
Last updated