eliom
eliom copied to clipboard
More efficient comet implementation
We should leave the requests pending for more than 20 seconds, sending keep-alive every so often to check that the connection is still live (something like sending something every 20 seconds and performing a new request when the client does no get any response after 30 seconds) and terminating requests only when too much data has been sent to the client.
Maybe we can use server-sent events, with a fallback for IE.
The Fetch API provides access to the server response as a stream, which might be better than XMLHTTPRequest which keeps the whole response in memory.
What about websockets ?
Presumably all network issues that have prevented WebSockets adoption still apply. Fragile interaction with proxies, an entirely separate protocol that firewalls may not like, etc. But implementation-wise, we should be able to interact with ocaml-websocket without too much trouble.
I see etherpad lite used in many places without issues and it uses socket.io which uses websockets at least in some situations (i.e. I've seen websockets used but I don't know if there's a fallback).