Skip to content

RonNewcomb/react-cache

Repository files navigation

Global Cache

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 hours

Caches 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.

React + TypeScript + Vite

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors