From 019854c300a5d03fd9f1ac902eb800b8f55c7f4c Mon Sep 17 00:00:00 2001 From: Roberto Guido Date: Tue, 7 Jul 2026 23:01:15 +0200 Subject: [PATCH] perf: caching a bit missing avatars Signed-off-by: Roberto Guido --- lib/Controller/AvatarsController.php | 3 +-- tests/Unit/Controller/AvatarControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Controller/AvatarsController.php b/lib/Controller/AvatarsController.php index 547681b9b0..ca12671254 100644 --- a/lib/Controller/AvatarsController.php +++ b/lib/Controller/AvatarsController.php @@ -104,8 +104,7 @@ public function image(string $email): Response { private function noAvatarFoundResponse(): Response { $response = new Response(); $response->setStatus(Http::STATUS_NOT_FOUND); - // Clear cache - $response->cacheFor(0); + $response->cacheFor(60 * 60, false, true); return $response; } } diff --git a/tests/Unit/Controller/AvatarControllerTest.php b/tests/Unit/Controller/AvatarControllerTest.php index f3562a6c0e..076bbccf2f 100644 --- a/tests/Unit/Controller/AvatarControllerTest.php +++ b/tests/Unit/Controller/AvatarControllerTest.php @@ -107,7 +107,7 @@ public function testGetImageNotFound() { $expected = new Response(); $expected->setStatus(Http::STATUS_NOT_FOUND); - $expected->cacheFor(0); + $expected->cacheFor(60 * 60, false, true); $this->assertEquals($expected, $resp); } }