diff --git a/src/Controller/RelatedRorController.php b/src/Controller/RelatedRorController.php index 39f8de6..3e6b984 100644 --- a/src/Controller/RelatedRorController.php +++ b/src/Controller/RelatedRorController.php @@ -125,14 +125,8 @@ class RelatedRorController extends ControllerBase { return array_sum($weighted); } - private function cachedJsonResp(array $data) { - $data['#cache'] = [ - 'max-age' => 600, - 'contexts' => [ - 'url', - ]]; - $resp = new CacheableJsonResponse($data); - $resp->addCacheableDependency(CacheableMetadata::createFromRenderArray($data)); + private function cachedJsonResp(array $data): Response { + $resp = new JsonResponse($data, 200, ['cache-control' => 'public, max-age=900']); return $resp; }