Return `Last-Modified` header in response for compatibility with Live.js
还没有人认领这个 Issue。
评估
调研方向
首先定位 babashka.http-server 中静态文件响应的处理逻辑及其 HEAD 请求路径。将所需行为与 ring.middleware.not-modified 进行比较,然后验证响应是否包含基于所提供文件的 Last-Modified,这样 Live.js 就不会依赖 Content-Length。
由索引模型根据 Issue 内容生成。
描述
I can contribute a PR here if desired. Just want to document the bug first.
Description:
babashka.http-server is used with Live.js to hot-reload changes to HTML, CSS, and JS. It uses HEAD requests to check the following headers: Etag, Last-Modified, Content-Length, and Content-Type.
Problem:
babashka.http-server doesn't return Last-Modified headers in the HTTP response. This means Live.js will fall back to using Content-Length to determine if there are new changes. It's possible for this to cause missed reloads since some changes (such as changing an integer in CSS) will result in the same Content-Length even though the content has changed.
When I use python3 -m http.server to serve the same files, I don't miss any changes even if the output file length is the same.
Solution:
Use ring.middleware.not-modified or something similar to add the Last-Modified to the HTTP responses.
- 主要语言
- Clojure
- 星标
- 86
- 派生
- 12
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
nextjournal/clerk#830 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 67/100