Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

php: waiting for other slow websites



Eric C wrote:
> hi all.  i'm using data from other folks websites on
> my website.  when a user views my page i update the
> database and then display it to the visitor. 
> unfortunately the websites i get info from are really
> freakin slow sometimes.  i would like to gather the
> info independent of the visit.  it's on a lazy managed
> host. can somebody offer a keyword or two to google
> with to give me a clue?  - eric c.

What I think you need is to use one of the techniques for updating a web
page dynamically, like REST or AJAX.  The basic idea is that you create
the dynamic parts of your page with some sort of <div> or other block
tag with an id set.  Then you have a JavaScript function (called by
onload) get the content from the other site using XmlHTTPRequest().
When it gets the content, it sets those <div> (or whatever) blocks to
that content.  But the point is that the page paints without first
waiting for the dynamic content.  It's all asychnronous.  And you can
set those <div> blocks to some sort of "please wait..." message until
the data gets there.


Google for "AJAX" (more "hot" and "now" and flexible) and REST (easier)


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org