<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Mon, 20 May 2013 23:11:13 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Deshong's Blog: Who's Online with PHP and Memcached]]></title>
      <guid>http://www.phpdeveloper.org/news/8705</guid>
      <link>http://www.phpdeveloper.org/news/8705</link>
      <description><![CDATA[<p>
<i>Brian Deshong</i> has <a href="http://www.deshong.net/?p=46">this new post</a> on his blog today with an alternative method for doing the old standby "who's online" for your website.
</p>
<blockquote>
Whenever you Google around for things like "Who's Online php", you'll find that a lot of the solutions are centered around using a database. However, is this really necessary? [...] One goal here: get Who's Online functionality off of the database. We'll explore a possible solution with Memcached that I've personally implemented, and thus far, it's been working great.
</blockquote>
<p>
His alternative, using the <a href="http://us.php.net/memcache">memcache functionality</a> that can be enabled in PHP, stores a "user ID" (either a real user ID or just some unique identifier) and their last activity time. This information is stored in a local file that can be queued each time the page it loaded. The other piece is a backend script that goes through this same file and clears out the old values. Depending on the size of the file/traffic of the site, this process could even be integrated into the same script that writes it.
</p>]]></description>
      <pubDate>Fri, 21 Sep 2007 15:13:25 -0500</pubDate>
    </item>
  </channel>
</rss>
