Optimizing a Static Site
hackernoon.com
hackernoon.com
When it comes down to it, what you should be optimizing for is efficiency of delivering information to your users. Animations don't help there in cases like this. And I doubt the javascript is helping either.
EDIT: 1.8mb figure is from the bundle.js file from the author's live website
This was me documenting my updates - I just revised the article with a few more updates, and the total site size is 250kb, 99kb without images. This still isn't great, but total page speed is pretty quick (js execution takes ~70ms on my 2016 MBP).
Thanks for the feedback!
All the best.
If I have to wait for it to download, it sure will slow down the page.
> [...] fully load in less then 200 ms
On how fast of a connection? It's one thing for you web app to load quickly on my university's (very nice) network, but quite another for it to work on my apartment's fritzy, bussy wifi, or at the hackerspace when 10+ other people are sharing 2MB/s.
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)
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.
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.
Thanks!
Go forth and prosper amongst the people who will pay you for the value you provide. Ignore us.
"Wooah, we need to toggle a class here!" "We got jQuery for that!"
"We also need to.." "Oh, we got this for that!"
Take this page as an example. It freaking huge, and the writer seems to think he has done a good job optimizing it now.
The page is really simple, and still a 1.66 MB JS bundle is required to even begin rendering the page.
And still the page doesn't work properly if you just do something as simple as view one external link and press the back button in an attempt to get back.
I know of a JS framework that might fix it, and it's only 7.6 MB. /s
Seriously, people should write about stuff they know.
I do disagree with the idea of including code from others being a bad practice/smell. The detriment and added load time of using a library like jQuery is well worth the functionality it provides, IMO.
Thanks for the comment and for pointing out a problem with the article, though - I've revised it!
Keep being you. HN hated Dropbox, of all things. I am hesitant to announce my product here because I struggle with as widespread of negativity as I perceive here.
If someone isn't going to buy what you're selling, I feel they should be silent and just not buy. If they would buy with a small tweak, there are ways for Bad PMs to put up their credit card. Otherwise, ignore their advice, ignore mine, and keep pushing.
For the people who ask for more, yeah. There's always room for improvement. But if you take down people within our community, you can go sit and spin.
Anyone using this ?
(For example, test all sites on "regular 2g network" simulation and compare these times)
I think I remember reading about some esoteric differences with real life - related to dropped packets vs merely rate limiting the connection with HTTP2.