From 2abf754c139a1253df9bb4e51a9ee4eb50ff6c70 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 11:29:52 +0100 Subject: [PATCH] add stale time to player data so it doesn't fetch it so often --- src/components/player/player-data.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/player/player-data.tsx b/src/components/player/player-data.tsx index 37ec510..9b44806 100644 --- a/src/components/player/player-data.tsx +++ b/src/components/player/player-data.tsx @@ -34,6 +34,7 @@ export default function PlayerData({ const { data, isLoading, isError } = useQuery({ queryKey: ["player", player.id], queryFn: () => scoresaberService.lookupPlayer(player.id), + staleTime: 1000 * 60 * 5, // Cache data for 5 minutes }); if (data && (!isLoading || !isError)) {