: Append a query string, usually a timestamp, to the end of the filename each time you change it. This will cause the URL to be different and force the browser to fetch a copy of the fresh
Append a query string, usually a timestamp, to the end of the filename each time you change it. This will cause the URL to be different and force the browser to fetch a copy of the fresh file.
Example:
app.ourwebsite.com/downloads/installer.zip?17245123784
That query string won't affect the file or the download. It will just force the file to be fresh each time it is changed.
OR
Serve the file through a script that sends no cache headers and then forces the download.
Example:
app.ourwebsite.com/downloads/download.php?file=installer.zip
<?php
$file = '/path/to/file/outside/www/installer.php';
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
?>
More posts by @Pope3001725
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.