Re: [Server-Sent Events] Network connection clarification

On Tue, 10 Jul 2012, Kornel LesiĆ~Dski wrote:
> 
> However, I'm afraid that the most common implementation (aside from 
> complete lack of error recovery) will be a simple as 30-second retry 
> interval and that won't be very DoS-safe. UAs can do better than that.

That's not entirely clear.


> For example the spec could require UAs to have randomized retry interval 
> and exponential backoff on failure. Is there anything more that authors 
> could do client-side to avoid DoSing?

Exponential back-off isn't at all necessarily the right solution. In 
particular, consider mobile devices, where network connectivity goes in 
and out as the user moves. Most of the time, you want to be trying to 
connect as soon as you have connectivity. Similarly with laptops on wifi 
where the connection is only briefly hurt by an obstacle -- you want to 
keep trying every few seconds until the obstacle is gone. Exponential 
backoff if a terrible thing in those kinds of situations.

You can distinguish local network difficulties from server load 
difficulties in a variety of ways, e.g. having a dedicated ping server on 
the same network as the "real" server, which doesn't suffer from the same 
load concerns, and which you try to contact and only switch to exponential 
backoff if it responds but the main server isn't. And so on. UAs can do 
that kind of thing.


> SSE is mostly a convenience API (advanced authors can use streaming XHR 
> or WebSockets to achieve the same result the hard way), so lack of 
> convenience in error recovery feels like an omission in this API.

If it's something we do want to eventually support, I think it's be 
something to consider for v2.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 10 July 2012 22:52:28 UTC