This commit is contained in:
boyska 2018-10-15 11:14:11 +02:00
parent 2226a2e899
commit ce74097ddc

View file

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