Forums: Back End:

 

Error 304 with RSS feed

first
 

Napalm Error 304 with RSS feed

We've just finished a site with a currency RSS feed. The feed has been running without problems for about 6 weeks - then, as Murphy would have it, it screws up a day after launch.

This is the source of the feed.

ansuz.sooke.bc.ca/rippy/exchange/?M=R&B=ZAR&F=USD,EUR,GBP&T=B&S=O&I=L

This is the error message:


Unable to open RSS Feed ansuz.sooke.bc.ca/rippy/exchange/?M=R&B=ZAR&F=USD,EUR,GBP&T=B&S=O&I=L with error HTTP ERROR: 304, exiting

Over the years I've come to realise my life is a Dilbert sketch
quote
 

scudsucker

As that suggests a "not modified", how about adding a random number to the querystring?

 

Stickman

Apparently, 304 means 'not modified'. Usually this relies on some sort of hash (etag) in the request which it compares with the current file to see if it's changed. However from the sound of it, the software is throwing a 304 regardless. What software are you using to serve the RSS feed?

StickBlog - random developer stuff
quote
 

Napalm

I use RSS2html to process the RSS feed, and been using it for a couple of weeks without incident. guerilla.co.za/stuff/currency.zip

Over the years I've come to realise my life is a Dilbert sketch
quote
 

Stickman

Oh BTW, the feed works fine for me.

StickBlog - random developer stuff
quote
 

Napalm

As it does for me. It's only on the site that it is screwing up.

Over the years I've come to realise my life is a Dilbert sketch
quote
 

Stickman

Oh sorry, I wasn't paying attention.

OK, so a quick glance at the code suggests that the author didn't bank on getting a not-modified header, so treats it as an error. If you look at line 526 in FeedForAll_XMLParser.inc.php, it throws an error if the HTTP status code is less than 200 or more than 300.

Since you're not caching the feed data, you're going to have to ensure that a 304 is never returned. Try scud's idea of appending a random string to the feed request. If this doesn't work you're going to have to store the feed data and return this cached version when you get a 304.

BTW, It might be that the supplier of the feed has had problems with excess load and has instigated this not-modified header to reduce it. So circumventing using cache-busting might not be a popular choice.

StickBlog - random developer stuff
quote
 

Napalm

Thanks - that didn't work. ***** burns down small villages ***** Should I replace the RSS2html with something else? Any suggestions with what?

God, I'm such a designer.

Over the years I've come to realise my life is a Dilbert sketch
quote
 

Stickman

Hmm...well I just installed your script on my server and it works fine for me. I'm beginning to wonder whether your server specifically is being excluded by this feed. Do you have permission to use it?

From the source site:


...please remember that I'm an amateur, providing these on a rented server which I pay for out of my own pocket, without advertising nor any other direct sources of revenue. So: please don't overload my bandwidth with excessive hits. Standard practice in the RSS community is to consider a refresh rate of up to once per hour acceptable, and I won't in general consider your use abusive if you stay within a reasonable factor of that. For feeds that only update infrequently, however, it may be more appropriate to use a lower refresh rate. If you are running a server which takes a lot of hits from the general public, it would be preferable for you to cache the files on your end instead of passing those hits through to me.


You're not doing any caching, so every hit on the page on your site is a hit on his site too. You need to look at storing the results locally and only updating (say) once per hour.

StickBlog - random developer stuff
quote
 

Napalm

Thanks Stickman - I'll try that. Crash

Over the years I've come to realise my life is a Dilbert sketch
quote
 
first
 

Forums: Back End: Error 304 with RSS feed

 
New Post
 
You must be logged in to post