Hacker News new | ask | show | jobs
by iUsedToCode 3020 days ago
"However, it’s only 829kb, and that includes every single non-image asset (fonts, css, all libraries and dependencies, and js)."

Only 829KB? ONLY?

This[1] is a (dynamic) on-line course for all beginner sport shooters in Poland, each page takes about 15KB. And i still sometimes want to rewrite the CSS, as it's now 3 requests. It shouldn't make a difference on HTTP/2, but that's a lame excuse.

It's not very fast (100-200ms) and maybe i should get a faster server -- there's room for improvement. But in my view, if it's static, it's supposed to be as fast as a native app on your smartphone. 1MB of bullshit js that nobody wants is not "ONLY".

Btw, maybe mine is lame and ugly. But i couldn't sleep if i made people load 1MB of fonts, javascript and CSS. It's just a shameful waste.

[1] https://patentstrzelecki.eu/ (polish)

5 comments

Agreed. I tried taking this to the extreme with my personal site. It's down to ~30ms on free Netlify for first and subsequent loads, always <10kb including content, with one HTTPS request per page load. No external dependencies, reasonably readable, 100% passing in Lighthouse. The highest leverage things are usually to delete anything font related, reduce or remove media and GZIP/minify. More obscure approaches include base64ing a fake favicon to get rid of the extra call, eliminate media, eliminate all requests but the core HTML static resource, inline everything, move to a faster host with lots of CDN edges, test aggressively with slow connections and eliminate until <100ms. Mostly because it's fun, also useful though if you serve a user base in developing world.
I also moved to netlify (from a gh-pages/cloudflare setup). And while I'm a huge fan, and loved the process, I am interested that google crawler seems to have found it a lot slower.

https://i.imgur.com/RUssvAA.png

I've SSL enabled (as well as HSTS) And yes, the initial redirect seems to take a while. But equally the very first page request from a site is actually quite slow I feel. Considering it's a static page of less than 4kB, I'd expect it to be a bit snappier...

I've other reasons for trying netlify, and I'm not too bothered about the slowdown (my site has bugger all traffic tbh), but I would like to get to the bottom of it.

Could you link your personal site if it's not too personal?
I had a similar reaction. I was hoping the article would touch on less obvious things, and I even read it as 829 bytes the first time (then was confused for a second). Hard to take it seriously after that.
You're right of course. One can even create a simple single-page application without using frameworks and external libraries and fit it in 5% of the mentioned size. I built verbatim [1] in 24KB, JS, CSS, all image assets included. It is a an SPA and works pretty fast, scoring 100/100 on both desktop and mobile Google PageSpeed tests.

The issue is when trivial applications grow in complexity. Any custom approach is seldom scalable. Especially when more people are brought on to work on a project and have to get up to speed. There is a strong argument to using popular frameworks (react, angular), which comes at a cost of massive app bundles. It is not, however, reasonable to use for static sites in any case.

[1] http://verbatim.link/

Original author here - thanks for your feedback, just updated the article. I kind of settled at ~1mb because I thought it was good enough. I got it down to ~90kb (which still isn't great, but is fine for these purposes) by just stripping out font awesome.

Thanks!

Jon, I run a few sites in a similar space. I feel 1MB is fine for my customer base. If HN isn't your customer, don't worry about them. If HN is your customer, you have the hardest job in the world because none of us will ever pay you anything you can build a business off of.

Go forth and prosper amongst the people who will pay you for the value you provide. Ignore us.

That's exactly what I thought before. I was starting to think that it was shared as a kind of joke or sarcasm towards web development in general.