Jump to content

Recommended Posts

Hm.. I was always under the impression that AJAX was pretty slow. Even if it's faster how is it possible to create something 'live' without being extremely inefficient? Isn't AJAX just low-level http requests? Wouldn't you have to run an Ajax request every few seconds to query the server to see if there are any updates? Or is there another way that I'm just completely oblivious to?

Link to comment
https://forums.phpfreaks.com/topic/181553-ajax/#findComment-957650
Share on other sites

what about facebook chat? - Same idea. The webpage makes an ajax request every few seconds. If you have enough dedicated servers its not an issue. Remember, Meebo doesn't have to query its OWN servers. it queries the servers by AIM, Yahoo! chat, myspace, etc. to see if any new messages were posted.

Link to comment
https://forums.phpfreaks.com/topic/181553-ajax/#findComment-957653
Share on other sites

I guess I have another question about systems like these, it's probably pretty obvious but I'm just not sure. Would systems like these pass information through an AJAX request then the script that it queries relays information to a socket server? Is it something like that?

Link to comment
https://forums.phpfreaks.com/topic/181553-ajax/#findComment-957691
Share on other sites

what about facebook chat? - Same idea. The webpage makes an ajax request every few seconds. If you have enough dedicated servers its not an issue.

 

If you had something huge like Facebook going on.  You probably would quite a few dedicated boxes just for the chat. Multiple 1,000,000 users sending http request via ajax every 2 seconds, you will be going like 500,000 requests per second.  That would quickly become unwieldy. It would cost a lot of $ to have that feature.

(My opinion)

Link to comment
https://forums.phpfreaks.com/topic/181553-ajax/#findComment-957725
Share on other sites

Yes, it would require a lot of dedicated servers, but facebook already had the resources, even before it launched its chat feature. And I'm sure the effort was well worth too.

 

Firing an ajax request every few seconds seems necessary. This is really the only way the server can track if a person is online. Most people don't bother logging off; they simply click the "x" on their browser.

Link to comment
https://forums.phpfreaks.com/topic/181553-ajax/#findComment-957743
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.