Cross-Origin Storage API: Ending duplicate downloads for browser AI

Browser cache partitioning is a well-intentioned security measure, but it creates a real headache for Web ML.

AI model weights and Wasm runtimes are often identical across different sites, yet each origin must download and store its own copy.

The toy example in the article shows a 177 MB duplicate download of Xenova/whisper-tiny.

en simply because the second site lives on a different origin. The same problem hits the 4,733 kB ONNX Runtime Wasm file shared by every Transformers.js pipeline.

This waste is not a bug—it’s the direct consequence of partition-by-origin design that prevents timing attacks, but it punishes legitimate cross-site sharing of big, immutable resources.

Experimenting with the proposed Cross-Origin Storage API in Transformers.js

View Original