A lightweight React library for automatic cache busting in production builds. Version 0.1.8 provides a simple mechanism: during build, it generates a meta.json file containing the package version, and at runtime, a React component fetches that file, compares versions, and clears the cache/reloads the page if a new version is detected. It integrates with any React app (React >=17.0.2, Node >=10) and is TypeScript-friendly. Differentiators: zero-config setup via a single script and component, supports a custom loading component, and works with any hosting since meta.json can be served statically. Release cadence is irregular; last update was in 2021.
npm install react-cache-busterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup of the build script and wrapping the app with CacheBuster component.
Set metaFileDirectory to the subdirectory path (e.g., '/myapp/' or '.' if root).
Ensure the script runs before other build steps that might write to public/meta.json.
Use isEnabled to disable in development; the cache busting is intended for production only.
Verify that your server configuration serves the public folder as static content.
Run 'npm install react-cache-buster' or 'yarn add react-cache-buster'.
Ensure you are not passing a ref to CacheBuster; it does not support ref forwarding.
Pass a valid string version, e.g., currentVersion={version} from package.json.Verify the meta.json exists in the public folder and the metaFileDirectory prop is correct. In production, the file must be served from the server.