We have a website (pure html/js/css). In our site pages, we have links to PDF files, these links looks like this: <a href="../files/myFile.pdf">My file link</a>
. So, the problem: sometimes we need to update our PDFs. We update these files, then go to the website, press the link - and we see old file. Ctrl+F5
, or F5
in Firefox - and we see updated file. It is not good. I think that this problem caused by caching.
In our site pages (html pages, which contain links), we added such tags:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
But it does not help. How can we avoid client-side caching?
I read some questions here. This solution had been taken from stackoverflow) Also I know about adding random parameter into page URL, but some guys say that it is bad way.
Please, help with this problem. Can we avoid client-side caching only with JS? Maybe it is possible with .htaccess
file on server side, but we have no access there.