user()->id); $servers = []; $userService = new UserService(); if ($userService->isAvailable($user)) { $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}\""); } }