Weedpacket;11055209 wrote:With file_get_contents() the empty string would be because the file contents got consists of the body of the response - no body, no content. Dunno why the full-page response in the other case (perhaps the target server mistakenly handles the HEAD as a GET).
I don't see a stream context option to not strip headers from an HTTP response; the next step in that direction would be down a level to fsockopen() or stream_socket_client(). Which would mean chasing redirects ourselves because we left those upstairs at the HTTP level....
Yeah, sounds a pain for sure, 😛 If I decide to read headers, I'll just reimplement the fetch method in cURL. I think, for now, I'll leave it as is. I modified it to just check mtime on our copy and re-fetch if it exceeds a threshold. Like I say, if the prospective client communicates that this is such as concern as to not do business with us, I'll do what's needed to make 'em happy.
Sneakyimp, thanks for the comments regarding control. That might be an overlooked fact in our business plan, and worth remembering next time I'm involved in discussions with the Sales guys ;-)