Hi,
On Mon, Oct 10, 2016 at 2:00 PM, marekgregor <
marek....@gmail.com> wrote:
> Hello Simone,
>
> thank you for your invaluable insight into possible implementation issues
> with SSE. From my point of view the only advantage of SSE comparing to
> websocket is that it should work seamlessly under HTTP/2
Sure, but so does long polling.
> (as far as I know
> there is no specified solution how to run websocket under HTTP/2).
Indeed there is no solution yet for carrying WebSocket frames inside
the same HTTP/2 connection.
> But after reading your response, I totally agree with you that implementing SSE does
> not add value for systems running on HTTP/1.1.
And neither for those running on HTTP/2.
> Question is what to do for systems where HTTP/2 will be preffered version of
> HTTP protocol. Currently there is no possibility to use websocket with
> HTTP/2. I know that using HTTP/2 connections to same host are very cheap -
> it's always physically one connection which is multiplexed. So I am not
> sure, but I assume that CometD long-polling/callback-polling+HTTP/2 will be
> sufficient alternative with comparison to websocket+HTTP/1.1. Do you think
> it is viable alternative now or in near future ?
I don't see such a big problem using WebSocket for what it has been
designed for: bidirectional web communication.
As such I would totally understand if you designed a HTTP/2 +
WebSocket application: use HTTP/2 for landing pages and other
(non-main) pages, and use WebSocket for your "event" pages.
Max total connections opened to server: 2.
If you really want to save that additional WebSocket connection to
only use the HTTP/2 one, then HTTP/2 long polling can do it for you.
There is no strict need for SSE.
> Disclaimer: I am now architecting application for visualisation of real-time
> data, planned production use is in 2017. I plan to use HTTP/2 as preffered
> version of HTTP protocol with fallback to HTTP/1.1 for older browsers.
As I said, either HTTP (1.1 or 2) + WebSocket is a fine solution.
Either HTTP (1.1 or 2) + long polling is a fine solution too.
As I said, I would give SSE a shot if it carried some evident benefit
like WebSocket did.
I can't see any benefit, so I'm reluctant.
As a simple example, it's fairly easy in a HTTP + long polling
scenario to enable gzip *transparently* and have the communication
data compressed by the Servlet Container.
This can effectively improve performances and latencies (and we have
seen this in real deployments).
You cannot do gzipping in SSE, so if you have large JSON messages
(that typically compress very well), you would be stuck with non-gzip
and therefore worse latencies.