Performance things in lighthouse

Hey, i'm wondering can't know what LCP, FCP, and others means. and what type of images should i make them lazy loading? should i add the lazy loading to large images or specifically on small images? and in this image the image is 15KiB what should i do? what she wanted from me?
No description
18 Replies
b1mind
b1mind12mo ago
Largest* Contentful paint, First contentful paint. Its not complaining about the file size as much as it is the actual size? You can look into srcset to load different size images for different devices/screen sizes. So if you are loading a 1400x800px img you would also want to only load a 300x50 or w/e img for mobile. That is the jist of it.
itsMU1X
itsMU1XOP12mo ago
<img class="aspect-video" srcset="{hero400} 400w, {hero600} 600w, {hero800} 800w, {hero1000} 1000w" sizes="(max-width: 400px) 400px, (max-width: 600px) 600px, (max-width: 800px) 800px, (min-width: 801px) 1000px" src={hero} alt="Hero" width="600" height="300" /> that's my img with the srcset and sizes, where's the wrong part and why? if you replied make sure to mention me, thanks
Jochem
Jochem12mo ago
if you click the bell, then click all messages, you'll get pinged whenever someone says something in a post
No description
cmachdev
cmachdev12mo ago
I know this way, the another way how is it?
No description
b1mind
b1mind12mo ago
You can do it both ways, I used pug to simplify my test but https://codepen.io/b1mind/pen/VwQRyOv?editors=1010
b1mind
b1mind12mo ago
they do behave differently based on responsiveness (which really only matters if you are resizing not the initial screen size)
b1mind
b1mind12mo ago
You can view it as html maybe to get a better idea
No description
cmachdev
cmachdev12mo ago
I don’t understand the another way 😭
b1mind
b1mind12mo ago
which part? you are using a srcset attribute on the img tag its just a comma separated key/value pair key: img url value: device or page size.
cmachdev
cmachdev12mo ago
The 800w….
b1mind
b1mind12mo ago
<img src="https://picsum.photos/200/200" srcset="https://picsum.photos/200/200 600w, https://picsum.photos/600/600 900w, https://picsum.photos/900/900 1200w"/>
<img src="https://picsum.photos/200/200" srcset="https://picsum.photos/200/200 600w, https://picsum.photos/600/600 900w, https://picsum.photos/900/900 1200w"/>
so that one is based on viewport* or rather width of the page
<img src="https://picsum.photos/900/900" srcset="https://picsum.photos/200/200 1x, https://picsum.photos/600/600 2x, https://picsum.photos/900/900 3x"/>
<img src="https://picsum.photos/900/900" srcset="https://picsum.photos/200/200 1x, https://picsum.photos/600/600 2x, https://picsum.photos/900/900 3x"/>
is going to look at the device DPI/size of the screen. as I understand it. For the devices with higher DPI honestly I just do the dirty thing and make sure its a larger image sized down for the display xD but that is how I would do it proper
cmachdev
cmachdev12mo ago
Ok, I need to deep on it
itsMU1X
itsMU1XOP12mo ago
interesting, it looks better than the srcset attr
cmachdev
cmachdev12mo ago
Then the 800w is the same to write media=(min-width: 800)?
clevermissfox
clevermissfox12mo ago
Kevin Powell
YouTube
srcset and sizes attributes - [ images on the web | part one ]
Using srcset allows us to load in different versions of the same image based on the size of the viewport, or the pixel density of the user's device. This is really helpful as it's one relatively easy way to go about reducing bandwidth for users on lower end devices while ensuring that users on high-end devices get nice, crisp images. One cool t...
clevermissfox
clevermissfox12mo ago
Kevin Powell
YouTube
The HTML picture element explained [ Images on the web part 3 ]
The picture element is a little different than most HTML elements in how it works. It has some similarities to the video and audio element, as it gives us the ability to have different sources and it also uses the srcset attribute, which allows each source to actually have multiple sources... which is a bit strange. It's a powerful element whic...
b1mind
b1mind12mo ago
old skool Kevin! your syntax is bad but yea ig xD I'm sure there tech a difference but ya that is the idea. (I'm quickly watching these videos too xD)
cmachdev
cmachdev12mo ago
Ok, I am going to watch the videos as well Still watching those videos to understand, laugh don’t get it the other way 😢 I am understanding it a little bit
Want results from more Discord servers?
Add your server