Axios interceptor that adds automatic ETag caching for HTTP requests. It intercepts requests and adds If-None-Match headers, then caches responses with their ETags to return cached data on 304 responses, reducing bandwidth and server load. Current stable version is 1.4.0, with infrequent releases; communicates only via GitHub. Key differentiator: lightweight, zero-config ETag caching specifically for Axios, with optional custom cache storage (e.g., RxDB) and POST request support. Requires axios >= 0.24.0 as a peer dependency.
npm install axios-etag-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup of axios-etag-cache with Axios to enable ETag caching on GET requests.
Apply axiosETAGCache before adding other interceptors, or ensure order is correct.
Do not assume response.data is always present; check response.cached property.
Use import { axiosETAGCache } from 'axios-etag-cache'Run npm install axios-etag-cache and ensure correct import/require.