perf(frontend): enable gzip, cutting the JS bundle from 6.8 MB to 2.0 MB - #261
Merged
Conversation
demo.actyze.ai was effectively unusable on anything but a fast connection.
A headless browser could not finish domcontentloaded within 60 seconds, while
curl returned 200 immediately - the HTML arrives fast and then the page waits
on assets.
The production bundle is 6.8 MB and was served uncompressed:
content-length: 6810665
(no content-encoding, even when the client sends Accept-Encoding: gzip)
Both nginx base images ship `gzip` commented out in the default config, and
this server block never enabled it, so every visitor downloaded the full
6.8 MB on every cold load. Measured locally against the same bundle:
without gzip 6,810,665 bytes
with gzip 2,003,129 bytes (70.6% smaller)
gzip_vary is set so caches key on Accept-Encoding and do not serve a
compressed body to a client that cannot decode it.
This is pre-existing rather than a regression: the old nginx:alpine base had
gzip commented out too, and the bundle measures 6.6 MB of JS in both the
pre-hardening image and the current one. The base image change in #241 did not
cause it.
Not addressed here: the bundle is large in the first place. plotly.js,
xlsx, jspdf, html2canvas and codemirror are all bundled into a single
main.js with no code splitting. Compression makes the site usable now;
splitting the bundle and lazy-loading the heavy chart and export paths is the
real fix and deserves its own change.
Claude Code ReviewThe diff is empty — no code was attached to this PR for review. The description is well-written and the diagnosis is credible, but without the actual Security
Correctness
Code Quality / Architecture
Testing
AGPL Compliance
Bottom line: Please attach the actual diff. The change is low-risk in principle, but the specific nginx directives need to be reviewed before approval. Automated review by Claude Sonnet 4.6 | Context: CLAUDE.md + README.md |
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
demo.actyze.aiis effectively unusable on anything but a fast connection.A headless browser could not finish
domcontentloadedwithin 60 seconds, whilecurlreturned 200 immediately — the HTML arrives fast, then the page waits on assets.Cause
The production bundle is 6.8 MB and was served uncompressed:
Both nginx base images ship
gzipcommented out in their default config, and this server block never enabled it. So every visitor downloaded the full 6.8 MB on every cold load — 15.7s on my connection, and well past 60s on anything slower.Fix
Measured locally against the same bundle:
70.6% smaller.
gzip_vary onis set so caches key onAccept-Encodingand never serve a compressed body to a client that cannot decode it.Not a regression from the hardening work
Worth stating clearly, since #241 changed the nginx base image:
nginx:alpinebase also hadgzipcommented outsha-5cbc75d) and the current oneSo this has always been the case. The base image change did not cause it.
Not addressed here
The bundle should not be 6.8 MB in the first place.
plotly.js,xlsx,jspdf,html2canvasandcodemirrorare all bundled into a singlemain.jswith no code splitting.Compression makes the site usable today. Splitting the bundle and lazy-loading the heavy chart and export paths is the real fix and deserves its own change — 2 MB is still a lot to ship before first paint.
Deploy note
This only takes effect once the frontend image is rebuilt and redeployed.