title: php & mysql live feed
body: <p>I'm attempting to build a live-updated system in php-mysql (and jQuery).
  The question I have is if the approach i'm using is good/correct or if i should look into another way of doing it:</p>
  
  <p>Using jQuery and AJAX i have made:</p>
  
  <pre><code>setInterval(function() {
    Ajax('check_status.php');
  },4000);
  </code></pre>
  
  <p>in check_status.php i use memcache, to check if the result is either 1 or 0</p>
  
  <pre><code>$memcache = new Memcache;
  $memcache-&gt;connect('127.1.0.1', 11211) or die ("");
  $userid.$key = md5($userid."live_feed");
  $result = $memcache-&gt;get($userid.$key);
  if($result==1) {
    doSomething();
  }
  </code></pre>
  
  <p>The idea is that user A does something, and that updates the memcache for user B.
  The memcache is then being checked every 4 seconds via jQuery, and that way i can do a live_feed to user B.</p>
  
  <p>The reason i use memcache is to limit the mysql_queries and thereby limiting the load on the datbase.</p>
  
  <p>So the question is. Am i totally off here ? Is there a better way of doing this, to reduce the server load ?</p>
  
  <p>Thank you</p>