From d77af9ac69ac41ea50b3aa1a28aee0c24b02163a Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 26 Jul 2022 18:58:31 +0100 Subject: [PATCH] feat: query client server stale time --- src/lib/query-client.server.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/query-client.server.ts b/src/lib/query-client.server.ts index e99dc83a..54138ccf 100644 --- a/src/lib/query-client.server.ts +++ b/src/lib/query-client.server.ts @@ -1,11 +1,12 @@ import { QueryClient } from '@tanstack/react-query' -const cacheTime = parseInt(process.env.CACHE_MAX_AGE || "600000") +const staleTime = parseInt(process.env.CACHE_MAX_AGE || "60 * 60 * 1000") const queryClientServerIn = new QueryClient({ defaultOptions: { queries: { - cacheTime, + staleTime, + cacheTime: staleTime * 2, }, }, })