Jump to content

http 304 error from file_get_contents


rubing

Recommended Posts

I am trying to parse an xml/rss url, however when I try to get the url i get a http 304 not modified error.  For example if I try to retrieve the file using file_get_contents, I receive the following error:

 

Warning: file_get_contents(http://www.xroxy.com/rss) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 304 Not Modified in /home/rubing/public_html/mysite.com/public/xml.php on line 2

 

 

I guess this is b/c apache is keeping a cached copy of this page??  How do I tell it not to cache it.  Or alternatively retrieve this cached copy?? 

 

THank you very much!

Link to comment
Share on other sites

It seems like that website keeps people from making multiple requests... Try it yourself, go to the URL, and then use ctrl-f5 (reload without cache) you'll get the same problem. It's forcing people to use cache to save it the bandwidth. It's not your server, it's the way they handle multiple subsequent requests from the same IP.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.