added cache to the showAction to reduce network requests

This commit is contained in:
Luca Haid
2025-09-12 07:30:09 +00:00
parent 3b1be1c4b6
commit 33bf082ad3

View File

@@ -99,7 +99,9 @@ class FileController extends mfBaseController {
$originalPath = MFUPLOAD_FILE_SAVE_PATH . ($file->subfolder ? "/{$file->subfolder}" : "") . "/{$file->store_filename}";
if (!is_readable($originalPath)) self::sendError("Physical file not found");
header("Cache-Control: public, max-age=604800");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 604800) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s", filemtime($originalPath)) . " GMT");
$imageInfo = @getimagesize($originalPath);
@@ -140,4 +142,4 @@ class FileController extends mfBaseController {
readfile($cachedPath);
exit;
}
}
}