|
@@ -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;
|
|
|
}
|
|
|
|