It depends on how you output the file on the back-end. Depending on a language, be it PHP, Java or other, you can read the first line of your file and output it to the response.
To find out whether a file has changed: HTTP code 304 and browser-side caching may help in this case.