Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 898KB even without compression. Pretty good.

gzip'd it's roughly half of that but that particular web server (althttpd) doesn't (yet?) know how to compress output payloads.



It makes sense to pre-compress the static assets. Then the server can load the compressed ones directly, without requiring to link to the compressor, and of course pay the price of online compression.

I create two extra files for each static file (for some extensions):

    file
    file.gz  <-- with zopfli
    file.br  <-- with brotli
And the web server, depending on the `Accept-Encoding` header, would serve the right file.

The wasm module:

    $ ls -lh fiddle-module.wasm*
    -rw-r--r-- 1 motiejus motiejus 779K May 26 15:25 fiddle-module.wasm
    -rw-r--r-- 1 motiejus motiejus 323K May 26 15:25 fiddle-module.wasm.br
    -rw-r--r-- 1 motiejus motiejus 357K May 26 18:00 fiddle-module.wasm.gz


> And the web server, depending on the `Accept-Encoding` header, would serve the right file.

This web server (also part of the sqlite family of projects) doesn't yet know how to do that. https://sqlite.org/althttpd


Interesting comparing the sizes of different compressors. `gzip -9` gets to 374K, whereas you report zopfli taking it down to 357K.

And I had at first run `brotli -9`, being fairly confident in my memory that it had more than nine levels, but finding -h mentioning -# as 1–9, and not seeing --best (level 11) at the other end of the output, and that that’s the default (unlike gzip where I think the default is mostly 6), so that -9 actually makes it do a worse job. Sigh.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: