diff --git a/shared/cache/index.ts b/shared/cache/index.ts index 2f31459d..d3e9d3ca 100644 --- a/shared/cache/index.ts +++ b/shared/cache/index.ts @@ -1,5 +1,11 @@ import { QueryClient } from 'react-query'; -const queryClient = new QueryClient(); +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: 10 * 1000, // 默认缓存10s + }, + }, +}); export { queryClient };