View Full Version : RSS Display Boxes - have to refresh the browser 2 or 3 times to get it working!

12-18-2008, 01:38 PM
1) Script Title:
RSS Display Boxes

2) Script URL (on DD):

3) Describe problem:
I had the script all setup and running great, and it still works except when I check the website that's running the script for the first time. It goes through the 'initialising rss box...' phase, the message disappears and there's no contents. When I check the cache folder (it's set to 777) it's empty. If I refresh the browser once or twice, suddenly the rss feed appears as it should, and if I check the cache folder I see it has placed a file there.

I don't understand why I have to refresh the browser a couple of times to get the thing working (I've tested it in Opera, Netscape, Firefox, IE and Safari, and it's the same in each).

Anybody have any ideas?

12-18-2008, 05:06 PM
I'm not entirely sure if this has solved it, but the feed I was using was one from my wordpress on another account. I changed the feed WP gives from rss2 to rss and have been testing it by deleting the cache and refreshing the browser contents. So far it seems to parse the feed without problem when using the rss feed, but still lingers and freezes short of refreshing the browser a few times with the rss2 feed. I've no idea why this might be.

12-19-2008, 12:51 AM
It could just be that your server was taking a long time to fetch the feeds (server connection issue), in which the script timed out while requesting the feed. That would explain why it was only temporary.

12-19-2008, 08:59 AM
Thanks DDAdmin - I'm inclined to think that may be a possiblity. I tried another box with another feed, and that works everytime, but I am finding my wordpress RSS is still a little hit and miss.

I can find a variable in the code relating to cache time (it's default is 30 minutes), but the problem is I can't find anything relating to how long it might take to pull the feed from the server. It's not a particularly long feed or a particularly slow server, but until it grabs the feed and puts it in the cache, it still comes up blank unless I refresh at least one time. Obviously that's totally impractical for anyone who might wish to visit this site once it goes out to Joe Public. Any ideas anyone? :confused:;)

12-19-2008, 10:08 AM
The default maximum time allotted to fetch a feed is defined in the Simplepie Class itself (one of the files within the Simplepie folder). I can't remember what that default is. Regardless, if you're getting a blank result, then the problem appears more to do with your server rather than having reached Simplepie's allotted time. A blank page in PHP usually is due to PHP itself timing out, either due to the script exceeding PHP's Maximum Execution Time, or the server deliberately aborting the process because of insufficient server resources. That's just my theory anyway.

12-19-2008, 03:20 PM
You may be right, in which case I could be doomed short of finding a host with a faster server. I was testing it with a feed I created on another domain, but I added the wordpress feed I wanted to use in the final website version, and so far that has worked without any problems. Both feeds are hosted by the same company (I took a reseller account), but I guess they might be on different servers. Touch wood the server my feed is currently on remains efficient otherwise it's going to make a mess of my site!
If push comes to shove I'll try digging through simplepie.inc, but like you say, it's probably not going to make any difference.
Thanks again for taking the time to respond.