mirror of
https://github.com/coder/coder.git
synced 2026-09-21 12:44:32 +08:00
chore(site): enable react-query cache (#11113)
This commit is contained in:
@@ -14,17 +14,11 @@ 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,
|
||||
refetchOnWindowFocus: false,
|
||||
cacheTime: shouldEnableCache ? undefined : 0,
|
||||
networkMode: shouldEnableCache ? undefined : "offlineFirst",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user