Compress static responses
The front end takes minutes to load because nothing is compressed — half of #2.
It does render — eventually. The page is blank because the Wasm front end is several megabytes and none of it is compressed.
Measured from one machine, at one moment:
| Request | Result |
|---|---|
GET /composeApp.js |
31 kB in 1.1 s (28 kB/s) |
GET /223.js |
372 kB, still going at 20 s (18 kB/s) |
GET /85e3f78c0ccd806f1bf2.wasm |
696 kB, still going at 25 s (28 kB/s) |
GET gitlab.com/…/nexascriptdebug-main.tar.gz (control) |
341 kB in 0.46 s (738 kB/s) |
The control rules out the client's link. At 16–28 kB/s a multi-megabyte front end takes minutes, during which the visitor sees an empty page with no error — which is what my half of #2 described as "the canvas is never mounted". Waiting long enough does mount it.
The server installs ForwardedHeaders, CachingHeaders, DefaultHeaders and CORS, but never Compression, so every byte goes out raw. This installs it: gzip and deflate, minimum size 1 kB, media excluded because it is already compressed.
This does not make the underlying 16–28 kB/s link fast. That is worth looking at separately — it is an order of magnitude below what the same client gets from gitlab.com — but it is not something this repository controls.
Testing
Verified against a locally running server (./gradlew :server:run, config without trustedFullNode), on a branch that also carries !46 and a local fix for the millinow build break described below: GET /tx/0001 returns Content-Encoding: gzip, and the response drops from 5,726 bytes to 1,374 — 4.2x, in line with what .wasm and .js should see.
One caveat: :server:compileKotlin does not build on main as it stands, before any change here. Five Unresolved reference 'millinow' errors in Routing.kt and home.kt; millinow() is commented out in libnexakotlin (platform.kt:110), so the version resolved here no longer exports it. I fixed that locally to get the server up (System.currentTimeMillis() at all five sites) but left it out of this merge request, since it is an unrelated thing. Happy to send it separately if useful.
Co-authored with Claude Code