Return `Last-Modified` header in response for compatibility with Live.js
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định phần xử lý response cho static file và đường dẫn request HEAD của nó trong babashka.http-server. So sánh hành vi cần thiết với ring.middleware.not-modified, sau đó kiểm tra rằng các response có Last-Modified dựa trên file được phục vụ, để Live.js không phụ thuộc vào Content-Length.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Clojure
- Star
- 86
- Fork
- 12
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Build fails with `compile-css`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nextjournal/clerk#830 ·
-
nREPL server never answers a request with non-ASCII text that arrives in more than one chunkĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
penpot/penpot#13540 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100