This commit is contained in:
Huong Nguyen
2025-05-15 12:00:41 +07:00
3 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -2609,8 +2609,8 @@ function send_file($path, $filename, $lifetime = null , $filter=0, $pathisstring
header('Cache-Control: private, max-age=10, no-transform');
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
header('Pragma: ');
} else { //normal http - prevent caching at all cost
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform');
} else { // Normal http - prevent caching at all cost.
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0, no-transform', 'no-store');
header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
header('Pragma: no-cache');
}
+2
View File
@@ -622,6 +622,8 @@ class repository_filesystem extends repository {
$filename = $options['filename'];
}
$dontdie = ($options && isset($options['dontdie']));
// If the file is linked to the original then we should not cache it.
$lifetime = 0;
send_file($file, $filename, $lifetime , $filter, false, $forcedownload, '', $dontdie);
} else {
send_file_not_found();
+8
View File
@@ -167,4 +167,12 @@ class repository_user extends repository {
public function contains_private_data() {
return false;
}
#[\Override]
public function send_file($storedfile, $lifetime=null , $filter=0, $forcedownload=false, ?array $options = null) {
// If the file is linked to the original then we should not cache it.
$lifetime = 0;
parent::send_file($storedfile, $lifetime, $filter, $forcedownload, $options);
}
}