mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 02:04:38 +00:00
Return a Cache-Control
header for files served via the API
This commit is contained in:
@@ -81,6 +81,7 @@ class FilesApiController extends BaseApiController
|
||||
if (file_exists($filePath))
|
||||
{
|
||||
$response->write(file_get_contents($filePath));
|
||||
$response = $response->withHeader('Cache-Control', 'max-age=2592000');
|
||||
$response = $response->withHeader('Content-Type', mime_content_type($filePath));
|
||||
return $response->withHeader('Content-Disposition', 'inline; filename="' . $fileName . '"');
|
||||
}
|
||||
|
Reference in New Issue
Block a user