mirror of
https://github.com/TryGhost/Ghost.git
synced 2023-12-13 21:00:40 +01:00
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
1 changed files with 9 additions and 1 deletions
|
@ -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 a new issue