From e5cc8be9d5f8899417aa0716b8b29c596417af61 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 31 May 2018 14:27:26 +0200 Subject: Fix usage Signed-off-by: Roeland Jago Douma --- core/Controller/AvatarController.php | 8 -------- core/Controller/PreviewController.php | 10 ---------- 2 files changed, 18 deletions(-) (limited to 'core/Controller') diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php index 14709d65fed..11d81ab00b2 100644 --- a/core/Controller/AvatarController.php +++ b/core/Controller/AvatarController.php @@ -141,16 +141,8 @@ class AvatarController extends Controller { return $resp; } - // Let cache this! - $resp->addHeader('Pragma', 'public'); // Cache for 30 minutes $resp->cacheFor(1800); - - $expires = new \DateTime(); - $expires->setTimestamp($this->timeFactory->getTime()); - $expires->add(new \DateInterval('PT30M')); - $resp->addHeader('Expires', $expires->format(\DateTime::RFC1123)); - return $resp; } diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php index e18487363a1..3dfc4872d01 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -174,17 +174,7 @@ class PreviewController extends Controller { try { $f = $this->preview->getPreview($node, $x, $y, !$a, $mode); $response = new FileDisplayResponse($f, Http::STATUS_OK, ['Content-Type' => $f->getMimeType()]); - - // Let cache this! - $response->addHeader('Pragma', 'public'); - - // Cache previews for 24H $response->cacheFor(3600 * 24); - $expires = new \DateTime(); - $expires->setTimestamp($this->timeFactory->getTime()); - $expires->add(new \DateInterval('P1D')); - $response->addHeader('Expires', $expires->format(\DateTime::RFC2822)); - return $response; } catch (NotFoundException $e) { return new DataResponse([], Http::STATUS_NOT_FOUND); -- cgit v1.2.3