Split The code is public; the app answers only to the crew.
The bundle arrives compressed: 96 KB of JavaScript is 41 KB on the wire #94
commented
Current numbers at 9c1997d, since the body quotes the ones from fafd988: the bundle is 111,070 bytes, gzipping to 47,118 — it has grown 15 KB in a week (#91, #81, the radio and penetration all landed since). The saving the issue describes is therefore bigger than it was written: about 58% of the download, on every first visit, still served with no content-encoding at all.
Sign in to join this conversation.
new above
offline
The page ships 96,506 bytes of JavaScript and the server never offers to compress it: a request with
accept-encoding: gzip, brcomes back with nocontent-encodingat all. The same bytes gzip to 40,851 — 58% of the download is being thrown away on every first visit, and the first paint's HTML (14,236 bytes) is uncompressed too.src/server.ts:215returnsscriptCodeas a string, andBun.serveadds nothing.Done looks like
Files I expect to change:
src/server.ts,src/bundle.ts(returning bytes as well as text, if that reads better than gzipping in the server), possibly a smallsrc/compress.tsfor the negotiation rule so it is tested on its own,src/server.test.ts.Risks: an
accept-encodingvalue is a header a client writes — parse it, do notincludes("gzip")your way pastgzip;q=0(a test for that is cheap); the forge's proxy may already compress, so double-encoding is the failure to watch for — check the preview's response headers and say what you saw;content-lengthmust describe the bytes actually sent; the/static/file branch atsrc/server.ts:226servesBun.fileand can stay as it is, but say which branch you covered.Brief that fits: scout — this is the server and its tests, no game code.