You should be able to send an empty Accept-Encoding server to the server, and then it should not send gzipped content or return a Not Acceptable response:
$string = file_get_contents( "http://www.winnipegsun.com/home/rss.xml", FALSE, stream_context_create( array( 'http' => array( 'method' => "GET", 'headers' => 'Accept-Encoding:\r\n' ) ) ) ); var_dump($string);
I'm not sure that the web server is configured correctly, because it would not respond to it with an uncompressed channel, even if you add the Cache Control headers telling it not to send a cached response. Oddly enough, just doing
$string = file_get_contents("http://www.winnipegsun.com/home/rss.xml?".time());
worked out of the box. And you can also send a POST request.
source share