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