Serve local UI static files gzip-compressed

未关闭
#437 0 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

维护者通常 1 天内回复

@lePereT 已经在做这个了。

开始于 2026年12月1日。

评估

这个 Issue 还没有评估数据。

描述

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.
主要语言
Lua
星标
1
派生
0
平均合并
1 天 8 小时
30 天内合并 PR
24

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jangala-dev/devicecode-lua 的其他 Issue

查看 jangala-dev/devicecode-lua 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。