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
It would be awesome to have a truly hot-reloading web server that updates the web page when the associated content file is modified. I would have to change the ring app to be async I think and use http-kit's support for websockets. Then on the server I could poll the .lastModified time of the content file every second and upon a modification I could send an event to the client JS via WebSocket that contains the full HTML or possibly just the body element. Then the client JS could replace the body tag with the new one from the WebSocket.
I should probably just send a WebSocket message every second from the client to the server to make sure that it's still open. I don't think sending small messages every second would waste that many CPU cycles. I don't want to get into a state where the server is polling the file forever even though the WebSocket is closed. I think the server will have to poll both the file and the client JS.
The text was updated successfully, but these errors were encountered:
stelcodes
changed the title
Make server web page auto-update in real time like MarkdownPreview
Make server web page content auto-update when content file changes
Aug 19, 2022
It would be awesome to have a truly hot-reloading web server that updates the web page when the associated content file is modified. I would have to change the ring app to be async I think and use http-kit's support for websockets. Then on the server I could poll the
.lastModified
time of the content file every second and upon a modification I could send an event to the client JS via WebSocket that contains the full HTML or possibly just thebody
element. Then the client JS could replace the body tag with the new one from the WebSocket.I should probably just send a WebSocket message every second from the client to the server to make sure that it's still open. I don't think sending small messages every second would waste that many CPU cycles. I don't want to get into a state where the server is polling the file forever even though the WebSocket is closed. I think the server will have to poll both the file and the client JS.
The text was updated successfully, but these errors were encountered: