title: need a solution ajax push mechanism
body: <p>I am developing a web application. where data need to be updated when ever there are changes.</p>
  
  <p>Currently I am putting an interval[5 sec] for fetching data from server[getting data with ajax requests].</p>
  
  <p>But here problem is unnecessary calls are going even though there is no update in the server data.</p>
  
  <p>Can any one tell me best solution for this.</p>
  
  <p>Below is sample code What I am doing:</p>
  
  <pre><code>setInterval(function() {
  $.ajax({
    "url": validURL,
    "dataType": "json",
    "contentType": "text/plain",
     "method": "GET"/"POST"
  }).done(function() {
    //After getting the response here updating the Ui elements here.
  });
  }, 5000);
  </code></pre>