mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(site): enable react-query cache (#10943)
This commit is contained in:
+6
-2
@@ -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",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user