FlowtandBriefAI · Software · ResearchMeet Flowtand

Proposed Cross-Origin Storage API Would Let Web Apps Share Model Files by Hash

Announcement

Hugging Face

Browse Developer tools topic page →

A guest post by Chrome's Thomas Steiner explores a proposed Cross-Origin Storage API, illustrated with Transformers.js. Today's browser caches are partitioned by origin, so identical model and Wasm files are downloaded and stored again for each site. The proposal would identify files by cryptographic hash rather than URL, with developer-set visibility and browser-verified integrity. The API is early-stage and not natively implemented in any browser; the author says an extension polyfill is available for experimentation.

What the proposal would change

Thomas Steiner of Chrome, writing a guest post on the Hugging Face blog, describes an early-stage Cross-Origin Storage proposal illustrated with Transformers.js. The problem is cache partitioning: browsers key cached responses by origin (in Chrome, a Network Isolation Key combining top-level and frame site) so one site cannot infer another's browsing from response timing. The consequence, per the author's toy examples, is that two origins using the same Transformers.js speech-recognition model each download and cache it, which he measures at 177 MB of duplication, and that unrelated pipelines still re-fetch a shared 4,733 kB ONNX Runtime Wasm file. The proposed navigator.crossOriginStorage interface would instead store and retrieve files by cryptographic hash, mirroring OPFS getFileHandle with create and an origins option. The browser verifies the hash on write, and visibility can widen but not narrow. The author states the API is not final and not natively implemented in any browser; he points to an extension that injects a polyfill for testing.

A scenario for a frontend platform engineer

Suppose a team maintains several public-facing web apps on different subdomains that all run a common speech-recognition pipeline and share ONNX Runtime Wasm assets. A platform engineer could, if the polyfill extension is installed in the team's test browsers, prototype a loader that first asks COS for a file by hash and falls back to the network on a miss, writing the fetched blob back with origins set to the company's own sites or, for public runtimes, to all origins. The realistic target is fewer repeat downloads across the team's own properties, not across the whole web, since a native implementation does not exist yet. This is a prototype against a proposal, not an integration the team can ship to users; any production path would still depend on the network.

How to trial it and measure

A team could try a small controlled experiment: load the same speech-recognition demo from two origins with the polyfill active, with cache clearing between runs, and compare bytes transferred against a baseline where each origin downloads independently. Useful measures are network bytes per origin on second load, whether a hash lookup returns a hit, and whether an intentionally corrupted write is rejected as the proposal claims. Failure checks should include confirming that loading without the polyfill behaves exactly as today and that a write with a hash mismatch fails rather than silently storing bad bytes. A developer should review results manually before drawing conclusions, since the polyfill is an emulation of an unfinalized design and may not reflect eventual browser behavior.

Trade-offs and unknowns

The design trades cross-origin efficiency for new questions the author raises, including whether probing for a file by hash leaks information about a user's browsing. That privacy trade-off is unresolved in the excerpt. Visibility is one-way upward, and widening access requires re-writing the full file, which the proposal explains as a guard against using upgrades as a side channel. Teams should not adopt this for anything user-facing today: there is no native implementation, the author calls the proposal early-stage, and any prototype depends on an extension. It is also a poor fit when assets are small, often change (hashes would change with them), or are proprietary and must stay within a defined origin list. A team should wait for the design to stabilize before planning production dependencies on it.

Context and limitations

  • Based on a short source excerpt; the full article was not analyzed.
  • The Cross-Origin Storage API is described as an early-stage proposal not final and not natively implemented in any browser.
  • Figures such as 177 MB and 4,733 kB come from the author's toy examples, not independent benchmarks.
  • Based on bounded source text, not independent testing. Practical suggestions are editorial proposals.