2

During piloting of new web app there was a request for feedback from the server, whilst it is performing certian tasks, like new collaborators on a document and log outs, etc.

So I implemented SSE (Sever-Sent Events) and it works fine and we are able to get the right feedback and nice in app messages 'Growl Style'.

My Question is this: Should I really be using SSE For push or just used good old Hanging Get.

From ITs point of view SSE seems to be fine but during certain tasks the app sets the rerty field retry: 500 so this increases the number of called to the server.

When I used Facebook like push notification (Hanging Get) I only get feedback when I am supposed to without checking.

-

Extraneous details

*We do not want to use web sockets at this time. I have implemented this but the app won't require this often.

Its not hard for me to use either SSE or Polling anytime, since I have an interfaces that I implement to an abstract class named PushService(); so at any time I can swap between SSEService and PollService *

Gunther Piez
  • 29,760
  • 6
  • 71
  • 103

1 Answers1

2

Well, the facts are:

  • SSE and Long Polling ("Hanging Get") accomplish the same thing -- pushing data from the server to the client when the server is ready.

  • Long Polling requires a hack to implement. SSE does not.

  • Long Polling works in all modern web browsers. SSE works in newer versions of most modern browsers, but does not work in any version of Internet Explorer (up to IE9 at the time of this writing).

Given these facts, it seems like the decision between these two is clear. If you need to support Internet Explorer or older versions of other browsers (e.g., most public-facing apps), use Long Polling. If you know you never will need to support those browsers (e.g., certain internal apps like company admin interfaces), use SSE.

Since your case is a pilot for a new web app, it seems likely you'll want to support as many browsers as possible, so go with Long Polling. You also mentioned in your question that Long Polling reduces the load on your server anyway, so that's an added bonus here.

Community
  • 1
  • 1
Ben Lee
  • 52,489
  • 13
  • 125
  • 145
  • @TheScripter, ah -- I see now that my reply was not very useful to you :). All I can say about the retry field is that I don't believe it matters except in cases where the network connection drops, and even then it won't hit your server more than once even it retries to connect frequently, because if the connection is still dead, well, it won't reach your server. Unfortunately, I don't have the means to test this hypothesis, but it seems to make sense, right? – Ben Lee Apr 24 '12 at 00:01
  • Yes Ben perfect sense!!. I will actually decide with IT leter this week which we'll consider in long term. Again my question was from a performance point of view and you helped with your latter comment. I understand which browsers support these features, but wondered about the public verdict. Thanks for your comment Ben. – The Scripter Apr 24 '12 at 00:07