I work on a HTML page (lets call it page1.php
) which includes a link to a PDF file (either to download it or see it in client’s browser). But this PDF may change sometimes and I would like to keep the same name / folder for the new version (the new one replaces the ancient every time). You may already know what my problem is : when I upload the new version of my PDF file, users see the ancient.
Here are the results of some tests :
- When I empty my browser cache, and I click on the link again, I get the new version of the PDF. So it is a caching problem.
- I tried what you can find about cache disabling on
page1.php
(see below). I checked the response header ofpage1.php
in the developper’s toolkit, and the headers are correct. But I still get then ancient version of the PDF after uploading a new one. Note that the cache folder of my file system keeps reciving new files after I flushing it and reloadingpage1.php
which he shouldn’t in my opinion.
<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">
or
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
Btw : my browser is Chrome 128.0.6613.113 and it load the PDF file directly in tabs
So i’m a little stucked here. Do you guys have any ideas ?
Thanks a lot
10