Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
07-24-2012, 06:13 AM #1
- Join Date
- May 2012
- Thanked 0 Times in 0 Posts
How does Facebook check for message updates?
I'm building a basic messaging system, and am currently checking for a user's message updates by querying the database every few seconds (running a php 'check' page initiated every 3 seconds using AJAX.
It works fine, but I'm curious as to how Facebook do it?
I notice two things...
1. If you load Facebook into your browser, typically there's no traffic unless something happens ie they aren't using AJAX to repetitively ping the database
2. When someone sends you a message, it instantly appears, and the speech bubble up top updates with the number of new messages - both without a page refresh.
Any ideas as to how are they doing this?