A caching adapter for axios that stores request results in a configurable store to prevent unnecessary network requests. Version 1.0.8, released as a fixed fork of the original axios-cache-adapter. It wraps axios to cache GET requests (configurable) using localForage or any compatible store. Key differentiators include simple setup via setupCache() or setup(), per-request cache option overrides, and TypeScript type definitions. It is a lightweight alternative to more complex caching solutions like react-query or SWR, but limited to axios-only use.
npm install axios-cache-adapter-fixedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an axios instance with a caching adapter that caches GET requests for 15 minutes.
Modify exclude.methods in cache options to allow caching other methods, or disable cache invalidation on write.
Replace 'axios-cache-adapter' with 'axios-cache-adapter-fixed' in imports and package.json.
Refer to the API documentation to see which options are overridable; test your expected behavior.
Avoid caching responses with non-serializable data, or implement a custom store that handles them.
Set exclude.query: false in cache options to include query parameters in the cache key.
Use import { setupCache } from 'axios-cache-adapter-fixed'.Run 'npm install axios-cache-adapter-fixed' and verify package.json includes the correct name.
Use 'await cache.store.length()' or '.then()' as the store API is promise-based.
Use 'cache.adapter' when creating axios instance: axios.create({ adapter: cache.adapter }).