title: Refreshing List of news using SignalR
body: <p>I have an asp.net MVC 4.0 application. In one of my views, I wish to display a list of current news (<code>IEnumerable&lt;News&gt;</code>) coming from a Web API.</p>
  
  <p>The thing is that the list of news may or may not be updated frequently. In other words, on an average day, the backend team may have to enter from 5 to 45 news using the backend CMS.</p>
  
  <p>I need to figure out a way to refresh the user’s list of news within his browser without, of course, refreshing the entire web page.</p>
  
  <p>My initial thought would have been to add a JavaScript <code>setInterval()</code> method that would call the Web API every X milliseconds thus pulling the information and refreshing the list of news.</p>
  
  <p>Although this would work, I would like to use a different approach and use <code>SignalR</code> since I believe the requirement fits with what <code>SignalR</code> has to offer.</p>
  
  <p>After reading and looking at some examples on <code>SignalR</code>, I’m starting to understand the idea behind it but I’m still a bit confused.</p>
  
  <p>The examples I see are Chat rooms and games where users can click stuff which triggers a call to the <code>hub</code>.</p>
  
  <p>In my task, the user <strong>WILL NOT</strong> have anything to click. The <code>hub</code> (server) should be responsible of calling the client every X milliseconds to update the list of news.</p>
  
  <p>In terms of performance, it would be ridiculous to send the entire list of news at each X milliseconds and overwrite the UI. </p>
  
  <p>I would need a way to compare the list of news currently showing in the user’s browser with the new list of news inside the hub. Once the compare is done, only send the new compared list of news.</p>
  
  <p>Does anyone have any example of such a scenario or can give me some pointers on how to get this started?</p>
  
  <p>Thanks</p>