Basically, there are two ways to do it.
1) The server checks if the file is newer:
We need to include in the request an "If-Modified-Since" header, and the server should reply with a "304 Not modified" response if the file is unchanged.
2) We check if the file is newer on the server:
We send a HEAD request to the server, and then check the "Last-Modified" response header.