Live data from Hacker News

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

endtimes.dev

131–140 of 356 posts

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

#132

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…

Even for text-centric sites fitting everything in 14kB is not always feasible if you use custom fonts. My site is text- and math-centric, but it uses some fonts (Crimson + bold and italic variants, plus the KaTeX fonts used for math). Each font is about 30kB big for a total of 180kB.

I would like to improve, but I feel like the fonts are essential for the look and feel, so I'm not willing to give up the fonts, so I guess the ~200kB is the lower limit for me.

(Of course, the fonts are cached on the next page load, so my site does load very fast after opening the first article. Only thing that bothers me is the layout jump-around due to font

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

#133
post #114

Earlier quoted context omitted.

Is there number, data, lab test session that proves it's worthwhile ? I sometime feel like these are all KPI detached from conversion but since it can be measured we do measure it.

that's what this blog post is about isn't it?

No, it's not.

edit: No, it's not. It deals with TCP window but in no way does it deal with customers conversion, retention rates and all those things.

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

#134
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.

That's correct, but it's important to keep in mind that JPEG XL is tuned for high quality images. If your baseline is heavily compressed JPEGs or AVIF images, switching to JPEG XL might save you nothing at all. However, if you're starting from 4+ MB high resolution JPEGs, and looking to save bandwidth while keeping the same quality, JPEG XL is vastly superior to anything else (including AVIF and WEBP).

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

#135
post #93

FWIW, the HN frontpage is 33kB. It's one of the better performing websites I frequent.

It's only 8kB compressed.

A fresh load of the page (according to Chrome) is 21.5kB transmitted, 59.1kB uncompressed. That's when loading with nothing cached. The HTML is just 7.9kB, but then the CSS is 2.2kB, JS is 2.3kB, and the favicon is 7.9kB which is a bit funny (but it's of course irrelevant for the actual page).

HN could put the CSS and JS into the generated HTML file and still stay under 14kB for the initial load, which then would give you almost everything needed to render the page except a few gifs.

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

#137

    Once you lose the autoplaying videos, the popups, the cookies, the cookie consent banners, the social network buttons, the tracking scripts, javascript and css frameworks, and all the other junk nobody likes — you're probably there.
Wouldn't videos and images (I guess css/js files as well?) loaded separately and be part of other messages?

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

#138
Another optimization in the same vein: make sure the first KB contains the element, to avoid false-starts in the HTML parser. In fact, it's actually specified as an _error_ in the spec to have it come after 1KB!

It's mentioned in passing on the Lighthouse docs for the charset audit[1], but here's a great breakdown by hsivonen[2].

Of course, in the headers is even better. Point is, try not to have too much cruft before the charset.

[1] https://web.dev/charset/

[2] https://github.com/GoogleChrome/lighthouse/issues/10023#issu...

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

#139

FWIW, the HN frontpage is 33kB. It's one of the better performing websites I frequent.

Yeah, the contrast with reddit is stunning.

When I open a reddit page on mobile, I usually open it in a new tab to give the browser time to load it. When I open a HN page, it's instant.

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

#140
Interesting find. On the other hand, it's not a one size shoe fits all metric. If the interaction with your website is mainly reading text, then sure it's a valid take. Otherwise you should really just forget about it and use focus on other best practices for providing a good early user experience.
Post reply on HN