Hacker News new | ask | show | jobs
by 420698008 850 days ago
Meanwhile the author has a ton of 1440p images while pegging his website width to 560px

I like the conversation about web performance, but you should make sure you practice what you preach

6 comments

720px actually, but more importantly, 720px is not actually 720px on a HiDPI screen.

I just measured it on my mbp and "720px" is actually... 1440 physical pixels. I was surprised too!

MBP device pixel ratio is 2 after all!
Even if you are not using an high resolution display like the sibling comment says, the images are reasonably sized (they are a few hundreds KB each). I have seen landing pages with 20-30 MB images for no good reason.
Don't forget the ones with background videos of random diversely raced young good looking models having coffee and looking at screens while nodding.
The images display at 720x720, on a 2x retina screen the image needs to be 1440x1440 to fill that.
The article is related to js bloat and the images are required for the presentation. The images come to 10MB - not bad. The js? 4.5KB!
> required for the presentation

But is such a high resolution really needed?

Sure, they could have been resized and squeezed through an imagemagick pipeline. But give the kid a break! He speaks the truth.
Some of my (non-programming) colleagues don't seem to be able to wrap their head around image size. And someone who taught courses to communication/marketing students told me, it took 2 hours to explain resolution and all that to them, and then half even didn't get it. Yeah, I can hear you: "something that easy? must have been a bad teacher," but the concepts are rather weird for non-techies. So those people become responsible for updating the website content, and upload whatever the graphical artists show them. And designers like to zoom in, a lot, so often that's a 20MB png, where a 200kB jpeg would suffice.
> I like the conversation about web performance, but you should make sure you practice what you preach

I'd say the author is practicing what he preaches, the JS is just 4,6 kB. There is some optimizations [1][2][3] that can be done to the images but I wouldn't fully disqualify the article because of that. The websocket connection is kinda odd though, I tried reading the code but didn't fully catch the purpose, it just says something about pointers.

[1] https://www.youtube.com/watch?v=uqmgQB5Gyfo [2] https://www.youtube.com/watch?v=uqmgQB5Gyfo [3] https://www.youtube.com/watch?v=hJ7Rg1821Q0