Serve local UI static files gzip-compressed

Aperta
#437 0 commenti 0 reazioni 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@lePereT ci sta già lavorando.

Dal 1/12/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

enhancement

Problem

src/services/ui/http/static.lua serves UI files uncompressed. The current local UI bundle from local-ui dev is:

File Raw gzip -9
JS 151 KB 55 KB
CSS 47 KB 8 KB

That's about 3x more bytes than necessary on every uncached page load, which matters most on weak Wi-Fi and older devices.

Proposal

  • Compress at build time. The build writes pre-compressed .gz copies next to the static files, so the box does no compression work at run time.
  • Choose per request. static.lua serves the .gz copy with Content-Encoding: gzip and Vary: Accept-Encoding when the request's Accept-Encoding allows gzip. Otherwise it serves the plain file.
  • Keep the existing headers right. Content type and caching headers must still describe the original file.

Done when

  • A browser receives gzip responses for JS, CSS and HTML.
  • A request without gzip in Accept-Encoding gets the plain file.
  • Unit tests cover both paths and a missing .gz copy.
Lingua principale
Lua
Stelle
1
Fork
0
Merge medio
1g 8h
PR unite (30g)
24

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jangala-dev/devicecode-lua

Tutte le issue di jangala-dev/devicecode-lua

Issue simili

Altre issue su Lua

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.