chore(site): enable react-query cache (#10943)

This commit is contained in:
Bruno Quaresma
2023-11-29 17:53:11 +00:00
committed by GitHub
parent e4d7b0b664
commit 2e8ab2aeaf
+6 -2
View File
@@ -15,13 +15,17 @@ import {
} from "@mui/material/styles";
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
const shouldEnableCache =
window.location.hostname.includes("dev.coder.com") ||
process.env.NODE_ENV === "development";
const defaultQueryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
cacheTime: 0,
refetchOnWindowFocus: false,
networkMode: "offlineFirst",
cacheTime: shouldEnableCache ? undefined : 0,
networkMode: shouldEnableCache ? undefined : "offlineFirst",
},
},
});