Skip to content

fix: enable gzip for static frontend assets - #159

Merged
hsluoyz merged 1 commit into
casosorg:masterfrom
bugkeep:fix/enable-static-gzip
Aug 18, 2026
Merged

fix: enable gzip for static frontend assets#159
hsluoyz merged 1 commit into
casosorg:masterfrom
bugkeep:fix/enable-static-gzip

Conversation

@bugkeep

@bugkeep bugkeep commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable gzip compression for embedded and disk-backed frontend assets.

CasOS currently serves the main JavaScript bundle uncompressed. On remote, low-resource machines, this makes the first browser load transfer several megabytes of JavaScript before the UI can start.

This change:

  • Enables Beego gzip support.
  • Compresses .js, .css, and .html assets when the client accepts gzip.
  • Adds Vary: Accept-Encoding.
  • Preserves the existing cache policy for hashed assets.
  • Keeps API, Kubernetes proxy, and ACME challenge responses unchanged.
  • Leaves HEAD and Range requests uncompressed.
  • Preserves conditional requests, including 304 Not Modified.

No new dependency is introduced.

Validation

  • go test -v ./routers -run '^TestStaticFilter' -count=1
  • go test . -run '^$'
  • gofmt
  • git diff --check

All checks pass.

@hsluoyz
hsluoyz merged commit de8219c into casosorg:master Aug 18, 2026
7 of 8 checks passed
@bugkeep
bugkeep deleted the fix/enable-static-gzip branch August 19, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants