mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05: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[];
|
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) {
|
function App({ghostVersion, officialThemes}: AppProps) {
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Reference in a new issue