php - How does facebook push data to news feed? -
php - How does facebook push data to news feed? -
i curious how facebook pushes info browser in news feed. new info shows @ top of feed without reloading page or clicking button facebook accomplish polling server through ajax @ set interval or somehow force new info server client unprovoked? if language or api utilize this?
it's called 'long polling', or 'comet'. there different ways perform server push mutual way maintain connection open while receives info (it has drawbacks browser have limit of number of open connections host). facebook had open-sourced tornado web servers, can handle lot of open connections (which can problem have lot of users, using apache example). in moment receive ajax response, perform new request, waiting next response.
php javascript ajax polling
Comments
Post a Comment