perf: add staleTime to queryClient to avoid excessive calls (#1740)

This commit is contained in:
Rômulo Penido
2025-03-13 22:24:02 -03:00
committed by GitHub
parent 82a76b0cad
commit 4f04698a60

View File

@@ -35,7 +35,13 @@ import { ToastProvider } from './generic/toast-context';
import 'react-datepicker/dist/react-datepicker.css';
import './index.scss';
const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 60_000, // If cache is up to one hour old, no need to re-fetch
},
},
});
const App = () => {
useEffect(() => {