A polyfill for the Cache and CacheStorage APIs, wrapping IndexedDB for offline storage without requiring HTTPS/SSL. Current stable version: 1.0.1. No active release schedule. Key differentiators: works without SSL, supports older browsers, and provides a drop-in replacement for the native Cache API used in Service Workers.
npm install cache-polyfillNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows opening a cache, adding resources, and matching a request using the polyfill.
Migrate to native Cache API or use 'cache-polyfill-broken'? No clear fix.
Ensure IndexedDB is supported or implement fallback.
Include a fetch polyfill from 'whatwg-fetch'.
Use ES modules: import { caches } from 'cache-polyfill'.Import 'whatwg-fetch' before using cache-polyfill.
Use caches.match(new Request(url)) or caches.match(url) (if polyfill supports string, but for safety use Request).