Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Tue May 30, 2006 3:50 am Reply with quote

I am trying to create a block that contains an XML from a specific url however, whilst this is a simple enough process in itself, it occured to me that it might actually create a problem for the site using the block.

In theory, if Site A uses a block that relies on an XML feed from Site B and for whatever reason, Site B (the feed supplier) goes down or has slow response time, what would be the most effective method to ensure the Site A (the site using the block) does not suffer adversly because of this?

An if_exists should take care of the potential problem of the XML feed site being down (possibly?) but would it be better to add some sort of timer to limit the amount of time the block tries to 'fetch' the feed?

Or would the answer lie in caching the feed (this has to be done within the block file code) and only updating the result if the feed 'responds' within a given time frame?

As always, any feedback appreciated, code examples more so Smile
 
View user's profile Send private message Send e-mail
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Jun 01, 2006 12:17 pm Reply with quote

Unfortunately, never done it. My initial thought was to cache the block and only have it refresh periodically. I would have to read up in the PHP manual regarding making http calls to get the XML and see if there are any timeout parameters that can be set.

Did you ever get any further with this?

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Thu Jun 01, 2006 5:18 pm Reply with quote

a friend of mine is good with xml,ill ask him if there's a simple way of doing this..
ill post again with an answer to that..
 
View user's profile Send private message
Guardian2003







PostPosted: Fri Jun 02, 2006 12:36 am Reply with quote

'M' - no I simply have not had the time to look at this further. I just got a bit paranoid that if I was to distribute a block which pulled data from an xml feed on one of my sites and the site went down or went slow, for whatever reason, this would adversely affect the block users site - something I certainly do not want.

hit - that would be great.

Thank you both your your feedback.
 
hitwalker







PostPosted: Fri Jun 02, 2006 5:24 am Reply with quote

hi guardian...
i called the guy and he said you cannot realy make this in xml cause it doesnt know how to act on the situation if nothing is available.
however he said that since your putting the xml in php you could write within a timer function ,like give it a response time of 5 seconds.
so if there's no reply from the xlm feed addresss in 5 seconds to show a custom text.
 
Guardian2003







PostPosted: Fri Jun 02, 2006 7:49 am Reply with quote

OK thanks Hit, I'll look into that.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©