jquery - Do you have any idea how Google Docs Javascript do the interval data autorefresh? -


alright, here goes:

i'm implementing software autorefresh/autopull/autoreload data keep screen live using ajax.

this working, know i´ve used simplest approach is:

  1. setinterval (javascript)
  2. call refresh method on , on each n seconds.
  3. read json data, rebuild html , update it.

this can done calling settimeout (javascript) , end of ajax request.

in refresh method internally check it´s not being called simultaneously, etc.

however... simplest approach, works but, in slow computers, firefox , ie, can see activity freezes browser, , know might not necessary because of ajax call, how "intensive" javascript operation overall... but, after running profiler, overall javascript (using jquery way) seem fine. if disable autorefresh, browser wont freeze short seconds in slow computers.

i decided investigate how several of majors ajax applications works out there.

facebook instance.. do request time, every n seconds, interpret json , update screen, but, google docs... can seem find request.. maybe because: telling javascript debugger engine not want request logged??, or, using approach refresh dilemma?

i read in answer here @ stackoverflow, google docs keeps open connection..

can answer? http://ajaxpatterns.org/http_streaming

what guys know this?

just side note, application i´m developing meant accessed thousands of users @ time, , know javascript refresh routine tells little part of history, server side application , database supporting such load according stress tests did using several thousands of virtualized stations. want know think client browser problem specifically.

regards , if still reading this.. time.

i suspect they're using websockets. browser support flaky, mileage may vary approach.

you may want @ ape (ajax push engine), decent implementation of long polling client/server architecture.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -