You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Actually I realize now that ring.middleware.not-modified doesn't actually add the header itself. That's handled elsewhere such as in ring.util.response/file-response.
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 usesHEAD
requests to check the following headers:Etag
,Last-Modified
,Content-Length
, andContent-Type
.Problem:
babashka.http-server
doesn't returnLast-Modified
headers in the HTTP response. This means Live.js will fall back to usingContent-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 sameContent-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 theLast-Modified
to the HTTP responses.The text was updated successfully, but these errors were encountered: