2

I need to find out status of an object which can change at any time. Best case scenario is if the object changes the client side gets updated, however I don't think there is plumbing for pushing updates to client-side without client-side asking for it first.

So, I'm thinking of implementing polling via jQuery ajax call that is set to a call server every 5 sec or so. Is this a reasonable solution?

ccellar
  • 10,326
  • 2
  • 38
  • 56
dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
  • I do simple jquery polling every 5min on our sites to check on the status and availability of our live chat support and update the page accordingly. – Todd Smith Sep 07 '11 at 18:33

1 Answers1

6

Best case scenario is if the object changes the client side gets updated, however I think there is plumbing for pushing updates to client-side without client-side asking for it first.

You may checkout SignalR which will allow you to achieve PUSH notifications to clients. As a result of this the traffic will be greatly reduced and your application will be very optimized.

So, I'm thinking of implementing polling via jQuery ajax call that is set to a call server every 5 sec or so. Is this a reasonable solution?

Yes of course, that's the classic polling technique if you don't want to do PUSH.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • You beat me to it :) Scott Hanselman had a nice article on it [here](http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx). – Bengel Sep 07 '11 at 18:06
  • @Bengel, that's exactly the article that I've linked to in my answer. – Darin Dimitrov Sep 07 '11 at 18:07
  • Just curious. Is SingnalR an official solution for creating a persistent connection in ASP.NET? I mean it isn't part of ASP.NET MVC. Will it be? Scott does say that SignalR is an "asynchronous signaling library for ASP.NET that our team is working on". Is it stable to use? – dev.e.loper Sep 07 '11 at 18:21
  • @dev.e.loper, it's in development and maybe even become part of the framework one day. – Darin Dimitrov Sep 07 '11 at 18:23