diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-09-28 20:25:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-28 20:25:15 +0200 |
commit | 1aa76e5968d8881daa4b9e72c0b9b0d4966ef934 (patch) | |
tree | 8be0f2a6c65e3edcb8f526f8f3acec4f3e3b9e72 | |
parent | 054d266c70fd1e8762398e68437e533dbb422349 (diff) | |
parent | f4a2ab137bb9e13672763f19edb44e156e758875 (diff) | |
download | nextcloud-server-1aa76e5968d8881daa4b9e72c0b9b0d4966ef934.tar.gz nextcloud-server-1aa76e5968d8881daa4b9e72c0b9b0d4966ef934.zip |
Merge pull request #34215 from nextcloud/bugfix/cache-headers-reference
Add cache header for image endpoint if link previews
-rw-r--r-- | core/Controller/ReferenceController.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Controller/ReferenceController.php b/core/Controller/ReferenceController.php index 2f6ef152d01..591d84f3e7c 100644 --- a/core/Controller/ReferenceController.php +++ b/core/Controller/ReferenceController.php @@ -59,9 +59,11 @@ class ReferenceController extends Controller { $appData = $this->appDataFactory->get('core'); $folder = $appData->getFolder('opengraph'); $file = $folder->getFile($referenceId); - return new DataDownloadResponse($file->getContent(), $referenceId, $reference->getImageContentType()); + $response = new DataDownloadResponse($file->getContent(), $referenceId, $reference->getImageContentType()); } catch (NotFoundException|NotPermittedException $e) { - return new DataResponse('', Http::STATUS_NOT_FOUND); + $response = new DataResponse('', Http::STATUS_NOT_FOUND); } + $response->cacheFor(3600, false, true); + return $response; } } |