Optimised react-query caching to prevent excessive requests (#17595)
refs https://github.com/TryGhost/Product/issues/3349
This commit is contained in:
parent
77cc6df64a
commit
cf947bc4d6
@ -16,7 +16,15 @@ interface AppProps {
|
||||
officialThemes: OfficialTheme[];
|
||||
}
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
staleTime: 5 * (60 * 1000), // 5 mins
|
||||
cacheTime: 10 * (60 * 1000) // 10 mins
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function App({ghostVersion, officialThemes}: AppProps) {
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user