Live data from Hacker News

A 14kb page can load much faster than a 15kb page

endtimes.dev

121–130 of 356 posts

Re: A 14kb page can load much faster than a 15kb page

#121
post #64

That's only doable with a text-centric website. I'm currently finishing a photography section for my personal website, and the gallery pages are several hundred kBs in size, while single photo page is almost 1MB in size (provided you load it on a 28" screen; browser will load smaller variants on smaller screens). Most of that weight is the thumbnails (and almost-full-size photo in the latter case). The only JS I have…

Once JPEG XL is widely supported those photos could be significantly smaller.

JPEG-XL is not really any better than WEBP. You need to be using AVIF "significantly smaller", just a shame that Google's online AVIF compressor sucks so-much (Wrong compression mode and uses the AV1 default artifact blending (Chroma Sharpening which is not really sharpening or even just for Chroma but actually sets the artifact blending. 0 is default for AV1 and tries to hide all artifacts, increasing to 3 which shows all artifacts).

Re: A 14kb page can load much faster than a 15kb page

#123

I like the idea mentioned in the article of increasing the number of packets sent in the slow start - as far as I know you could just crank that from the server side TCP stack to something much larger, right?

Yeah, now that most of us control the server, is this an option?

Re: A 14kb page can load much faster than a 15kb page

#124
post #95

I wonder if anyone has studied the impact of latency on user behavior while considering the impact of user expectations from their typical connection speed. Whenever I see an article about page speed optimization, the assumption is that a user will give up if a page takes too long to load, ans that everyone gives up after X seconds. Usually X is about 7s based on a Nielson article from years and years ago. The thing…

I don’t have a citation handy, but this is something that Google has famously studied. They claimed years ago that a tiny increase in the loading time of the Google home page led to a measurable decrease in the number of searches (like, a few percent). Not everyone is operating “at Google scale”, of course, but in aggregate the effect is real and faster-loading pages have better metrics. So, most satellite internet u…

most satellite internet users won’t give up just because your page is slow

My point is that 'slow' is a relative measure against other websites, not an objective value. So long as your website is faster than a typical website then users won't give up. Trying to be faster than average is worthwhile, but trying to be as fast as possible might not bring any additional value.

It's also possible (likely, in my opinion) that the website itself is important too. People expect Google to be fast because it's made by the biggest internet company there is, and perhaps because the page itself is very simple. It's just a textbox on a page. Surely it should be fast. That doesn't mean people have the same expectations for grannys-discount-wool.com.

This is a complex problem that probably doesn't have a straightforward answer. Using the mantra 'make your website as fast as possible' means you won't get it wrong, so it's worth doing, but you almost certainly get diminishing returns for that effort as you optimize for things like shaving off milliseconds and bytes.

Unless you're Google.

Although... that said... if Google really thought sites should be as fast as possible, wouldn't they make a smaller GoogleTagManager.js script?

Re: A 14kb page can load much faster than a 15kb page

#125
post #113
post #80

Earlier quoted context omitted.

I wish I could do this without breaking all the obnoxious sites that use fonts for icons. Someone should invent an HTML tag for putting images on a page.

I'm using icon font to show a grid of icons, where each icon can be clicked to toggle it "on" or "off". Example: https://i.imgur.com/EHYHVDw.png When I was implementing this, I initially experimented with the img tags – easy to implement, easy to have multi-color icons. But the grid can potentially have 100s of rows, potentially resulting in 1000+ of img tags. When testing with img tags, my site became noticeably slu…

i too use an icon font, but if you want images you should use a spritemap. it shouldn't be sluggish.

Re: A 14kb page can load much faster than a 15kb page

#126

https://sumi.news HTML is ~14KB when transferred with compression. The CSS is ~30KB. I could probably slash that in half if I optimized.

I should add that this depends on your subscribed sources. My page is ~13KB today, but it could be up to ~60KB if you have a lot of headlines. Most of the HTML is actually tailwindcss classes repeated for each headline. I wonder how much size I could save by replacing them with a single class-name. I assume it wouldn't make much difference to the compressed size.

Re: A 14kb page can load much faster than a 15kb page

#127

https://sumi.news HTML is ~14KB when transferred with compression. The CSS is ~30KB. I could probably slash that in half if I optimized.

Does the CSS get cached?

Yeah, it's a separate file. But because I'm using tailwindcss, the HTML actually has a huge number of classes. I'm not sure how much that matters with compression though.

Re: A 14kb page can load much faster than a 15kb page

#129

Earlier quoted context omitted.

1MB per photo is fine. It's the content after all. Many sites today will load 10MB of JS and custom font crap alone, just to show a few paragraphs of text. I don't think the point is the size itself, but it's the content vs. bloat ratio.

1MB per photo is massive. Its easy to compress photos down to 100KB or less.

This is simply false, even if you mean using AVIF.

Here's a test case, using a moderate sized (3000x2000) image. Nothing ridiculously huge or anything, and it's not an especially complex image. I'm linking the best I can do for both JPEG (at 200 KB) and AVIF (at 100 KB). If you can create a passable versions of these images at 100 KB with either codec (or WEBP for that matter), please do show us how.

Original image: https://0x0.st/o9x5.png

JPEG (200 KB): https://0x0.st/o93i.jpg

AVIF (100 KB): https://0x0.st/o9xC.avif

Maybe JPEG XL will get us closer, but not all the way there, that's for sure: https://0x0.st/o9xd.jxl - JPEG XL is intended for high quality images, so it is not optimized for this kind of extremely low bitrate (~0.1 bpp) usage.

Re: A 14kb page can load much faster than a 15kb page

#130
post #81

Earlier quoted context omitted.

Wat. 1MB per photo is tiny when the photo is the content. You need ~100KB for a high quality 512x512 WebP. AVIF will be slightly better but still doesn’t have universal support. We’ve had 4K (8MP) screens for a decade now and normal DSLRs shoot 25MP so you can zoom in.

Bandwidth is extremely carbon intensive. Someone viewing a couple of few 25MP images online could use 20g to 100g of CO2 (depending on compression).

Source ?
Post reply on HN