A lightweight cache sharing module for 3Box that uses an iframe to share cache across domains. Version 1.1.0 is the latest stable release. It is designed specifically for the 3Box ecosystem, providing proxied storage for OrbitDB and IPFS via postMessage communication. Key differentiators: enables cross-domain cache sharing without same-origin restrictions, tightly integrated with 3box-js. The library is minimal and focused on the iframe-mediated proxy pattern.
npm install 3box-shared-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create OrbitDB and IPFS storage proxies for cross-domain iframe communication, and how to start the server in an iframe.
Ensure postMessage is a function that calls the correct target's postMessage.
Use it as part of 3box-js with iframeCache option enabled.
Evaluate using native BroadcastChannel or other shared cache solutions.
Ensure postMessage is a function, e.g., (msg, target) => iframe.contentWindow.postMessage(msg, target).
Run server code only in a browser context (iframe).