Live data from Hacker News

A 14kb page can load much faster than a 15kb page (2022)

endtimes.dev

161–170 of 324 posts

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

#161
post #10

Aside from latency, reducing ressources consumption to the minimum required should always be a concern if we intend to have a sustainable future. The environmental impact of our network is not negligible. Given the snarky comments here, we clearly have a long way to go. EDIT: some reply missed my point, I am not claiming this particular optimization is the holy grail, only that I'd have liked for added benefit of red…

Do we? Let's compare some numbers. Creating an average hamburger requires an input of 2-6 kWh of energy, from start to finish. At 15¢ USD/kWh, this gives us an upper limit of about 90¢ of electricity. The average 14 kB web page takes about 0.000002 kWh to serve. You would need to serve that web page about 1-300,000 times to create the same energy demands of a single hamburger. A 14 mB web page, which would be a prett…

Slightly veering off topic but I honestly wonder how many burgers will I fry if I ask ChatGPT to make a fart app?

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

#162
post #7

The overlap of people that don’t know what TCP Slow Start is and those that should care about their website loading a few milliseconds faster is incredibly small. A startup should focus on, well, starting up, not performance; a corporation large enough to optimise speed on that level will have a team of experienced SREs that know over which detail to obsess.

I don’t see what size of corporation has to do with performance or optimization. Almost never do I see larger businesses doing anything to execute more quickly online.

Too many cooks spoil the broth. If you got multiple people pushing agenda to use their favorite new JS framework, disregarding simplicity in order to chase some imaginary goal or hip thing to bolster their CV, it's not gonna end well.

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

#163
post #122

Earlier quoted context omitted.

> the environmental impact of jackasses mining jackass coin, or jackasses training LLMs is not insignificant (this was actually stated in agreement with the original poster, who you clearly misunderstood, so there's no "what-about" involved here. They were condemning all kinds of consumption, including the frivolous ones I mentioned). But I'm afraid you've missed both my small point and my wider point. My small point…

> if the primary concern is simply to reduce resource consumption to a minimum ..."required". That allows you to fit pretty much everything in that requirement. Which actually makes my initial point a bit weak, as some would put "delivering 4K quality tiktok videos" as a requirement. Point is that energy consumption and broad environmental impact has to be a constraint in how we design our systems (and businesses). I…

carelessly thrown about accusations of whataboutism and strawmaning are an excellent example of whataboutism and strawmaning. I was making a specific point, directly to the topic, without either putting words in their mouth or addressing an unrelated issue. I'll stand by my retort.

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

#164

My plain HTML alone is 10kB and it is mostly text. I don't think this is achievable for most sites, even the ones limiting themselves to only CSS and HTML, like mine.

This is about your "plain HTML". If the rest is in cache, then TCP concerns are irrelevant.

Depending on who's visiting your site and how often, the rest probably isn't in cache though. If your site is a product landing page or a small blog or something else that people are rarely going to repeatedly visit, then it's probably best to assume that all your assets will need to be downloaded most of the time.

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

#165
post #95
post #74

I just checked my home page [1] and it has a compressed transfer size of 7.0 kB. / 2.7 kB main.css 2.5 kB favicon.png 1.8 kB ------------------- Total 7.0 kB Not bad, I think! I generate the blog listing on the home page (as well as the rest of my website) with my own static site generator, written in Common Lisp [2]. On a limited number of mathematical posts [3], I use KaTeX with client-side rendering. On such pages…

> That said, I do use KaTeX with client-side rendering on a limited number of pages that have mathematical content You could try replacing KaTeX with MathML: https://w3c.github.io/mathml-core/

If you want to test out some examples from your website to see how they'd look in KaTeX vs. browser MathML rendering, I made a tool for that here: https://mk12.github.io/web-math-demo/

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

#166
post #7

The overlap of people that don’t know what TCP Slow Start is and those that should care about their website loading a few milliseconds faster is incredibly small. A startup should focus on, well, starting up, not performance; a corporation large enough to optimise speed on that level will have a team of experienced SREs that know over which detail to obsess.

This idea that performance is irrelevant gets under my skin. It's how we ended up with Docker and Kubernetes and the absolute slop stack that is destroying everything it touches. Performance matters. We've spent so many decades misinterpreting Knuth's quote about optimization that we've managed to chew up 5-6 orders of magnitude in hardware performance gains and still deliver slow, bloated and defective software prod…

Containers were invented because VMs were too slow to cold start and used too much memory. Their whole raison d'être is performance.

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

#167
> Also HTTPS requires two additional round trips before it can do the first one — which gets us up to 1836ms!

Doesn't this sort of undo the entire point of the article?

If the idea was to serve the entire web page in the first roundtrip, wouldn't you have lost the moment TLS is used? Not only does the TLS handshake send lots of stuff (including the certificate) that will likely get you over the 14kb boundary before you even get the chance to send a byte of your actual content - but the handshake also includes multiple request/response exchanges between client and server, so it would require additional roundtrips even if it stayed below the 14kb boundary.

So the article's advice only holds for unencrypted plain-TCP connections, which no one would want to use today anymore.

The advice might be useful again if you use QUIC/HTTP3, because that one ditches both TLS and TCP and provides the features from both in its own thing. But then, you'd have to look up first how congestion control and bandwidth estimation works in HTTP3 and if 14kb is still the right threshold.

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

#168
post #53

Earlier quoted context omitted.

I know some people who are experimenting with using shorter certificates, i.e. shorter certificate chains, to reduce traffic. If you're a large enough site, then you can save a ton of traffic every day.

Please though, for the love of dog, have your site serve a complete chain and don't have the browser or software stack do AIA chasing.

With half of the web using Let's Encrypt certificates, I think it's pretty safe to assume the intermediates are in most users' caches. If you get charged out the ass for network bandwidth (i.e. you use Amazon/GCP/Azure) then you may be able to get away with shortened chains as long as you use a common CA setup. It's a hell of a footgun and will be a massive pain to debug, but it's possible as a traffic shaving measure if you don't care about serving clients that have just installed a new copy of their OS.

There are other ways you can try to optimise the certificate chain, though. For instance, you can pick a CA that uses ECC rather than RSA to make use of the much shorter key sizes. Entrust has one, I believe. Even if the root CA has an RSA key, they may still have ECC intermediates you can use.

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

#169

Earlier quoted context omitted.

This hasn’t been the case since TLS1.3 (over 5 years ago) which reduced it to 1-RTT - or 0-RTT when keys are known (cached or preshared). Same with QUIC.

Good to know, however "when the keys are know" refers to a second visit (or request) of the site right ? That isn’t helpful for the first data paquets - at least that what I understand from the site.

Without cached data from a previous visit, 1-RTT mode works even if you've never vistited the site before (https://blog.cloudflare.com/rfc-8446-aka-tls-1-3/#1-rtt-mode). It can fall back to 2-RTT if something funky happens, but that shouldn't happen in most cases.

0-RTT works after the first handshake, but enabling it allows for some forms of replay attacks so that may not be something you want to use for anything hosting an API unless you've designed your API around it.

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

#170
post #69

Earlier quoted context omitted.

Right. That’s why all the software from, say, Microsoft works flawlessly and at peak efficiency.

This. It's exactly why Microsoft use modern frameworks such as React Native for their Start Menu used by billions of people every day.

Wait… please please tell me this is a weirdly specific joke
Post reply on HN