Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6134319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:20:24+00:00 2026-05-23T17:20:24+00:00

Possible Duplicate: Using memcached as a database buffer for chat messages A friend of

  • 0

Possible Duplicate:
Using memcached as a database buffer for chat messages

A friend of mine was telling me how he used Memcache to build a PHP/Javascript realtime chat room, but I can’t figure out how Memcache would help when the data is updated (possibly) every few seconds. Of course, he told me to figure it out on my own.

Can anybody provide any hint as to what advantages Memcache would serve in such an application? (I don’t want to know how to do it exactly, just how Memcache would speed things up in an application where the data is constantly being updated.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:20:24+00:00Added an answer on May 23, 2026 at 5:20 pm

    Memcache is the PHP interface to memcached (memory object caching)

    It really isn’t the right tool for the job. He’s obviously storing the data as a key – this probably would be faster than hitting a database, but it still sucks.

    If you’re looking to implement some sort of real-time chat solution I would recommend looking into the following techologies. Read up on them and you’ll find a solution which may suit your needs.

    • Flash (AS3) sockets with a chat server OR
    • HTML5 Web Sockets OR
    • COMET (Facebook uses this.)

    Flash (AS3) sockets:
    There are many ways to build an Actionscript 3 chat system. It’s actually pretty easy if you use one of the many existing solutions out there. IE: Smartfox. You can even use the External Interface to trigger Javascript events every time a message is received.

    HTML5 Web Sockets
    As support for this is pretty flakey I recommend you look into degrading gracefully with Flash. Example of a library you can use: https://github.com/gimite/web-socket-js/

    COMET/Long polling
    This is quite an interesting approach. Effectively what you’re going to be doing is “blocking” the HTTP request server-side by not returning any data until some is available EG:

    while(!d = data()) {
        // no data...
    }
    return "{data : d}"
    

    Your browser will in most cases just sit there happily waiting for something to happen. Once data is received the browser will close the connection – this is when you process the data, and then re-open a connection (fire off a new ajax request) so that you are listening for new events!

    To accomplish this I recommend using a non-blocking server such as Tornado (http://www.tornadoweb.org/)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Using Memcache vs Memcached with PHP Someone can explain me the difference
Possible Duplicate: PDO Prepared Statements I'm using the mysqli extension in PHP and I'm
Possible Duplicate: php using special symbols (<?php echo $row_pageDetails['profile']; ?>) If profile is empty
Possible Duplicate: Using a javascript variable to set PHP variable I need to do
Possible Duplicate: Getting the screen resolution using PHP well the question is self explanatory
Possible Duplicate: php: using DomDocument whenever I try to write UTF-8 it writes the
Possible Duplicate: using jquery $.ajax to call a PHP function I need to call
Possible Duplicate: using seo user friendly in php I have 3 PHP files: index1.php,
Possible Duplicate: Using ASP.NET Controls without databinding My previous question yielded few results so
Possible Duplicate: Casting vs using the ‘as’ keyword in the CLR Which method is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.