Hi all...
On behalf of a client, I'm trying to post an XML feed of real estate listings on her site. This feed is set in stone and to make matters worse, is full of things that invalidate it such as & symbols. It has around 750 entries on any given day.
I thought I had found a way around the problems with the feed by using curl() to get the feed's contents, then using str_replace to get rid of the ampersands. In order to sort the feed so that it listed homes in price order, I then converted the string back into XML through a function found on PHP.net. Finally, I converted the XML into an array so that I could play around with sorting it.
All of this made for a page that took a long time to load--30-40 seconds--although the original feed takes around 20-30 seconds to load anyway if all you do is curl() it.
Is there a more straightforward way of doing this? I need to
a) get the XML feed
b) remove the characters that invalidate the XML
c) sort the feed
d) show only 10 items from the feed at a time
I'm not allowed to share the link to the feed as it comes with a subscription fee.
XML Feed - Loading Time Very Slow
Moderator: General Moderators
Re: XML Feed - Loading Time Very Slow
you did not mention how often the list changes. If is daily, you can just process it once(inside a cron) and create an html or whatever you want the output to be.
Re: XML Feed - Loading Time Very Slow
Unfortunately, it's updated periodically throughout the day. And part of the rules of using the feed is that I'm not allowed to cache it or save it anywhere before using it. It must come directly from the feed.
That said, what if I had the cron run hourly?
That said, what if I had the cron run hourly?