Skip to content

Commit 6f28e5c

Browse files
committed
caching
1 parent 7a707af commit 6f28e5c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ const queryClient = new QueryClient({
2121
},
2222
});
2323

24+
// Cache plugin metadata indefinitely since it doesn't change while the app is running
25+
queryClient.setQueryDefaults(['api', 'plugins'], {
26+
staleTime: Infinity,
27+
cacheTime: Infinity,
28+
refetchOnMount: false,
29+
refetchOnWindowFocus: false,
30+
refetchOnReconnect: false,
31+
});
32+
2433
if (['production', 'staging'].includes(import.meta.env.MODE)) {
2534
// Use a placeholder DSN as we'll be using the tunnel to proxy all Sentry React errors
2635
Sentry.init({

0 commit comments

Comments
 (0)