user['id']); $servers = []; $userService = new UserService(); if ($userService->isAvailable($user)) { $serverService = new ServerService(); $servers = $serverService->getAvailableServers($user); } $eTag = sha1(json_encode(array_column($servers, 'cache_key'))); if (strpos($request->header('If-None-Match'), $eTag) !== false ) { return response(null,304); } $data = NodeResource::collection($servers); return response([ 'data' => $data ])->header('ETag', "\"{$eTag}\"") ->header('Cache-Control', 'public, max-age=3600'); } }