Live data from Hacker News

Making a Website Under 1kB

tdarb.org

41–50 of 109 posts

Re: Making a Website Under 1kB

#41

1kB is charming, the site shows the limitation: it's not even very much text, there's limited room in the medium to leave one's mark. Not a thing wrong with haiku, but for a whole art movement, we'll get more mileage out of a one-trip website. Ignoring a bunch of caveats I won't get into, a normal TCP packet is no larger than 15kB, for easy transit across Ethernet: the header is 40 bytes, leaving 1460 for data. Allow…

Think you got your math off there. MTU of 1500 bytes = 1.5kB, not 15kB.

Re: Making a Website Under 1kB

#42

1kB is charming, the site shows the limitation: it's not even very much text, there's limited room in the medium to leave one's mark. Not a thing wrong with haiku, but for a whole art movement, we'll get more mileage out of a one-trip website. Ignoring a bunch of caveats I won't get into, a normal TCP packet is no larger than 15kB, for easy transit across Ethernet: the header is 40 bytes, leaving 1460 for data. Allow…

You forgot the HTTP header... Which is variable size, but unfortunately usually quite large.

They can easily be in the 500 to 1000 byte range, taking up most of the first TCP packet. e.g this HN page has a 741 byte header. I suppose if you control the web server you could feasibly skim this down to the bare minimum for a simple static page - not sure what that would be.

Re: Making a Website Under 1kB

#43

You don't need the quotes in many cases. Instead of: Try

will work just fine ;) Another fun trick is using since the spec says to pretend a space is there if not present for whatever reason ( https://html.spec.whatwg.org/multipage/parsing.html#parse-er... )

Well damn. That is an oddity.

Re: Making a Website Under 1kB

#44

For nowadays standards I consider anything below 500kB and with less than 6 server requests already pretty minimal, yet those are still numbers that can achieve a lot of things and still look so "modern"/"normal" that you'd have to look into the dev console to really appreciate the effort that has been put into these. Whenever I see websites that use 5MB large PNGs for photos and have over 30 requests over a time spa…

> For nowadays standards I consider anything below 500kB and with less than 6 server requests already pretty minimal, yet those are still numbers that can achieve a lot of things and still look so "modern"/"normal" that you'd have to look into the dev console to really appreciate the effort that has been put into these

500kB honestly doesn't require much effort at all. My WordPress blog with a popular theme and a few plugins has each almost every article below 500kB, despite looking like any modern blog and having at least 1 image per post.

Actually, if I remove the Facebook share button, they drop to almost 250kB. Time to remove it I guess.

Re: Making a Website Under 1kB

#45
post #33

I managed under 1.5KB for a page that has an actual function, not just a test: http://www.captiveportal.co.uk And yes, that’s supposed to be a non-https link. I think the entire site, including favicon, might be under 5KB. You can check here: https://github.com/josharcheruk/CaptivePortal

Is it really needed when browser (and linux distros!) have their own captive portal detection page ? (e.g http://detectportal.firefox.com/ or http://connectivity-check.ubuntu.com )

On desktop the automatic detection is pretty reliable. On mobile I find myself opening http://example.com with some regularity (the most common edge case is if a network with captive portal is configured to auto-connect, and I don't have a browser open).

Re: Making a Website Under 1kB

#46
Nice, always refreshing to see these small web pages projects. Shameless plug, but I had recently started a search engine [0] with the goal of generating search result pages that are only a few KB in size, backward compatible (HTML 4), and only takes 1 HTTP request per page (no images, inlined CSS, base64 encoded favicon). It's surprising how big the page sizes are for the popular search engines, you would think these pages would be small, but a google search result page can be over 1 MB in size and take over 70 requests.

[0] https://simplesearch.org

Re: Making a Website Under 1kB

#47
post #38

I had a look at https://cv.tdarb.org/ . You could reduce it even further. By: - removing quotes around attribute values - replacing href values with the most frequent characters - sorting content alphabetically - foregoing paragraph and line-break tags for a preformatted tag I was able to bring it from 730 bytes (330 had you compression enabled) down to 650 bytes (313 bytes after compressing with Brotli). Rewording t…

I tried that too but decided that saving a few bytes is not worth the parser restarting, so I adhered to strict XHTML for fast page load times.

Not worth the… what? I’m not sure what you’re talking about or thinking of, but I think you’re wrong. Parser restarting is purely when speculative parsing fails, and there’s nothing here that can trigger speculative parsing, or failures in it.

If you’re using the HTML parser (e.g. served with content-type text/html), activities like including the html/head/body start and end tags and quoting attribute values will have a negligible effect. It takes you down slightly different branches in the state machines, but there’s very little to distinguish between them, one way or the other. For example, consider quoting or not quoting attribute values: start at https://html.spec.whatwg.org/multipage/parsing.html#before-a..., and see that the difference is very slight; depending on how it’s implemented, double-quoted may have simpler branching than unquoted, or may be identical; and if it happens to be identical, then omitting the quotes will probably be faster because there are two fewer characters being lugged around. But I would be mildly surprised if even a synthetic benchmark could distinguish a difference on browsers’ parser implementations. Doing things the XHTML way will not speed your document parse up.

As for the difference achieved by using the XML parser (serve with content-type application/xhtml+xml), I haven’t seen any benchmarks and don’t care to speculate about which would be faster.

Re: Making a Website Under 1kB

#48

For nowadays standards I consider anything below 500kB and with less than 6 server requests already pretty minimal, yet those are still numbers that can achieve a lot of things and still look so "modern"/"normal" that you'd have to look into the dev console to really appreciate the effort that has been put into these. Whenever I see websites that use 5MB large PNGs for photos and have over 30 requests over a time spa…

> For nowadays standards I consider anything below 500kB and with less than 6 server requests already pretty minimal, yet those are still numbers that can achieve a lot of things and still look so "modern"/"normal" that you'd have to look into the dev console to really appreciate the effort that has been put into these 500kB honestly doesn't require much effort at all. My WordPress blog with a popular theme and a few…

Honest question—do actual real people use Facebook share buttons? Have they ever?

To me it looks like it has always been a fairytale made up by Facebook to spread their analytics scripts all over internet.

Re: Making a Website Under 1kB

#50

Earlier quoted context omitted.

> For nowadays standards I consider anything below 500kB and with less than 6 server requests already pretty minimal, yet those are still numbers that can achieve a lot of things and still look so "modern"/"normal" that you'd have to look into the dev console to really appreciate the effort that has been put into these 500kB honestly doesn't require much effort at all. My WordPress blog with a popular theme and a few…

Honest question—do actual real people use Facebook share buttons? Have they ever? To me it looks like it has always been a fairytale made up by Facebook to spread their analytics scripts all over internet.

Coincidentally, I used the fb share button this morning but it is a very rare occurrence.
Post reply on HN