I need to determine if a remote file exists or not.
I have used curl, but it propably reads whole file because it’s very slow.
Is there any fast method to “touch” a remote file (for example read only one byte of that file or return false when a 404 occurs)?
Also there could be a problem if tested domain does not exist or connection simply times out. So there has to be timeout interval set to lower than the usual value.
When you just want to check the existance of the file, you can use curl to make a
HEADRequest instead of aGET. This way the webserver will only answer with the header information (including the 200/404/… status code) and not the entire file