I have the below code, which simply downloads a file and saves it. I want to run it every 30 seconds and check if the remote-file\'s mtime has changed and download it if it has.
You can try to send the If-Modified-Since header with a correctly formatted date.
If the server supports it, it can answer just with a 304 Not Modified status (without any content) or the full content if the file has been modified.