My aim is - whenever the client requests a html page or a pdf file, javascript should check if the file has been requested before and is therefore cached. If it is cached and does not match the current one on the server (checksum?), the cached file should be cleared.
This must be done with Javascript only, no PHP or .htaccess magic.