Forum Moderators: coopster

Message Too Old, No Replies

How to speed up XML on an iframe via PHP tweaks?

         

irock

8:46 am on Sep 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, I recently joined a search partner that feeds me XML exclusively. By using XML parser, I'm able to retrieve the content from feed. However, as I tried to put the links on a iframe page, I noticed the iframe's still loading even after the rest of the page is loaded. The feed isn't a lot of stuff... just a few links and some text... Even though the iframe page isn't loading very slowly, most users generally have to wait a second or two to see the 250x250 iframe page loaded. Is there anything I missed that can speed things up?

Another observation, Google AdSense seems to be using iframe together with Javascript and it's freakingly fast.

Could anyone shed light in this performance issue?

Thanks!

vincevincevince

9:06 am on Sep 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cache your search results in ready to output form - update them on bulk once a day. that way you don't have the problem of having to download the XML feed and parse it every time before you can start outputting it

irock

3:29 pm on Sep 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How to cache BTW?

thanks

vincevincevince

6:43 pm on Sep 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



save to a local database or flatfile database

irock

4:47 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That comes to mind but my partner doesn't allow that. Their prices update too frequently.

MonkeeSage

4:56 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are using JavaScript document.write() or document.writeln() methods to populate the iframe you need to also do a document.close() after the writing is complete, otherwise it will just sit there and 'load' indefinitely.

Jordan.

irock

5:49 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



MonkeeSage,

Is there any benefit to using Javacsript to populate iframe?

Could you give ma a practical example?

Thanks!

MonkeeSage

8:24 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure how you are getting the values you parse from the XML stream into the iframe...but if you are using JavaScript, like,

window.frames['iframename'].document.write('Stuff to write');

You should also do...

window.frames['iframename'].document.close();

I'm not aware of any other way to put content in an iframe except making a physical page and loading it via the src attribute of the iframe. There is no advantage either way that I know of.

I was just guessing about why you would see the iframe loading still when the rest of the page was done, but if you're not using JavaScript already then my guess was wrong. Sorry for any confusion.

Jordan

vincevincevince

8:40 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"prices update too frequently" ... how frequently? surely not more than twice a day maximum? updating your database twice a day and serving from local files would be a much faster way

irock

4:01 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vincevincevince,

I don't think that's even possible technically... that's because i must use the person's IP to request for XML. So, if I cache two times daily, there would be only 2 IPs requesting XML and 1000 people clicking on only 2 XML feed links.

irock

4:10 pm on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



MonkeeSage

I am using PHP to parse the XML feed.

The XML links and logos appear too slowly on the iframe... I wonder if there's a solution beside caching that helps the situation.

BlueSky

4:23 pm on Sep 26, 2003 (gmt 0)

10+ Year Member



It's slow because you're constantly pulling this info from somewhere else and parsing it each time. If the other guy's server or the network has any problems, it will not only slow your site down but hang it up big time. I agree with vince go with caching. You could run a cron job to do the file update twice a day or hourly or whatever. The visitors won't see any slowness or hang ups.