Enable Brotli pre-compression for static assets#52
Merged
michaeldistel merged 2 commits intomainfrom Feb 14, 2026
Merged
Conversation
Build changes: - Add brotli package for pre-compression - Create compress-brotli.cjs script (75% reduction) - Integrate into build:prod pipeline - Generate .br files for 44 assets (1339KB → 333KB) - Skip files <100 bytes Infrastructure (ready for brotli when nginx versions align): - Add Dockerfile to deployment - Update nginx config with brotli_static (commented out) - Enable gzip_static for gzip pre-compressed files - Nginx config v1.3.0 Limitation: nginx:alpine 1.29 vs nginx-mod-http-brotli 1.28 version mismatch .br files generated and ready; will activate when versions align Current: gzip compression active Future: brotli will provide 15-20% better compression than gzip
Changes: - FROM nginx:1.28.2-alpine (was nginx:alpine latest) - Install and load nginx-mod-http-brotli modules - Enable brotli_static and brotli directives in nginx config - Nginx config version 1.3.0 Result: - Brotli compression now active (content-encoding: br) - Serving pre-compressed .br files (75% smaller) - Gzip fallback for old browsers Version pinning necessary until Alpine updates nginx-mod-http-brotli to 1.29+
4 tasks
Contributor
Author
|
✅ Fixed - Brotli now active! Pinned nginx to 1.28.2-alpine to match Alpine's brotli module version. Verified working: $ curl -sI -H "Accept-Encoding: br" https://controlforge.dev/_app/immutable/chunks/D6Fn0WwO.js | grep content-encoding
content-encoding: brFiles served:
Created #53 as reminder to upgrade when Alpine package updates. |
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.
Summary
Implementation
Build Pipeline:
Compression Results:
Infrastructure:
Known Limitation
nginx:alpine 1.29 vs nginx-mod-http-brotli 1.28 version mismatch prevents brotli module loading. .br files generated and ready; will activate automatically when Alpine package updates.
Current: gzip compression working
Future: 15-20% better compression with brotli vs gzip
Testing