News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Brian Deshong's Blog:
Who's Online with PHP and Memcached
September 21, 2007 @ 15:13:25

Brian Deshong has this new post on his blog today with an alternative method for doing the old standby "who's online" for your website.

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.

His alternative, using the memcache functionality 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.

0 comments voice your opinion now!
whos online memcache tutorial whos online memcache tutorial


blog comments powered by Disqus

Similar Posts

Rob Allen's Blog: Zend Framework Tutorials (an Update and Zend_Auth)

Zend Developer Zone: AJAX Chat Tutorial Part 6 : Updating the User List

DevShed: Building Object-Oriented Web Pages with Inheritance in PHP 5

Evan Coury's Blog: Using Zend\Dbs TableGateway & HydratingResultSet to return rows as custom enties

TechChorus Blog: Create RESTful Applications Using The Zend Framework


Community Events





Don't see your event here?
Let us know!


tips api release package symfony deployment install language opinion library list introduction laravel community podcast framework zendserver series update interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework