mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 01:58:41 +01:00
The SPA bundle was compressed on every cold page load. Writing a .gz sibling at build time and turning on gzip_static moves that work to the build: serving the 1.6 MB main bundle drops from ~71ms to ~9ms per request, measured over 25 requests against a local nginx. Level 9 is affordable when it runs once, though it lands within a percent of what nginx produces at runtime, so the win is the CPU rather than the bytes. Anything without a .gz sibling still compresses on the fly. The step is chained into build rather than a postbuild hook because frontend/.npmrc sets ignore-scripts, which stops npm running pre and post hooks at all. Node's zlib does the work, so no new dependency. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7