Include the file for a global cache.
import "./services/cache";Or import functions for config and control.
import { clearCache, setAutoclear } from './services/cache';
setAutoclear(8); // automatically clear cache every 8 hoursCaches GET calls until a non-idempotent operation occurs.
Can avoid cache with the fetch option cache.
const orders = await fetch("./orders", { cache: 'reload' })Also 'no-store' and 'no-cache' options will force reload.
This template provides a minimal setup to get React working in Vite with HMR.
npm create vite@latest my-react-app -- --template react-ts
npm install
npm run dev