perf(web): release inactive mutation state

This commit is contained in:
lingniu
2026-07-16 05:04:17 +08:00
parent 6f0c15fe6d
commit c4f6587120
3 changed files with 58 additions and 9 deletions

View File

@@ -5,17 +5,26 @@ import { AuthGate } from './auth/AuthGate';
import { RoutePage } from './routing/RouteBoundary';
import { RoutePages } from './routing/routeModules';
import { ROUTER_FUTURE } from './routing/routerConfig';
import { QUERY_MEMORY } from './queryPolicy';
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 15_000,
gcTime: 5 * 60_000,
retry: 1,
refetchOnWindowFocus: false
export function createPlatformQueryClient() {
return new QueryClient({
defaultOptions: {
queries: {
staleTime: 15_000,
gcTime: 5 * 60_000,
retry: 1,
refetchOnWindowFocus: false
},
mutations: {
gcTime: QUERY_MEMORY.highVolumeGcTime,
retry: 0
}
}
}
});
});
}
const queryClient = createPlatformQueryClient();
export function AppV2() {
return (