Download once,use everywhere.

Cross-Origin Storage (COS): a content-addressable browser cache
that shares files across origins by hash.

Thomas Steiner
Thomas Steiner@tomayac on the InternetGoogle Chrome

This deck dogfoods Cross-Origin Storage: all fonts, libraries, and AI models load through it.

Before you start

This browser doesn't support Cross-Origin Storage yet

The slides work anywhere, but the live demos need COS to share files across sites. To see it in action, open this deck with either of these:

Chromium logowith COSπŸ§ͺExperimental Chromium build with native COS
Chrome logoFirefox logoSafari logoCOS extension for Chrome, Firefox, Safari
A quiz

What do these two games have in common?

Screenshot of Quake
Quake
Screenshot of Doom
Doom

They ship the exact same Three.js engine: 734.5 kB of byte-identical JavaScript.

Byte-identical resources, used across different origins

It's not just games…

Web fonts

Noto Color Emoji on countless sites

Flutter logo

Flutter apps

Skia (CanvasKit) in every Flutter web app

JavaScript logo

Libraries

React, Vue, Angular…, each used on many pages

WebAssembly logo

Wasm

FFmpeg Wasm, SQLite Wasm…, the same builds on many sites

Hugging Face logo (Transformers.js) MLC AI logo (WebLLM) ggml logo (wllama, built on llama.cpp)

AI runtimes

Transformers.js, WebLLM, wllama, used by different apps

…and AI models are big

Gemma 4 E2B3.4 GB
Qwen3.5 2B1.6 GB
Whisper Tiny (English)152 MB

They profit the most from being shared across origins.

Web downloads via Transformers.js (q4f16; Whisper fp32).

Why the browser can't just reuse it

Caches are partitioned β€” for good reasons

In the good old daysToday, with cache isolation

quake.example
three.module Β· 2d144b25….js↓ 355.8 kB
three.core Β· c4f597c8….js↓ 378.7 kB
tracker-px-3f9a7c.js↓ 4.2 kB
doom.example
three.module Β· 2d144b25….jsfrom cache↓ 355.8 kB
three.core Β· c4f597c8….jsfrom cache↓ 378.7 kB
⏱️ tracker-px-3f9a7c.js2 ms: cached!↓ 4.2 kB

Shared caches let any site probe what you visited.

A script times ⏱️ how fast a file loads. Near-instant means it was cached, so you've been to a site that uses it.

Cache isolation prevents this.

HTTP cache key β‰ˆ (top-level site, frame site, URL), e.g. Chrome's Network Isolation Key.

The proposal

Cross-Origin Storage

Imperative API

Two calls: look up, or store

Read from COS

const hash = {
  algorithm: 'SHA-256',
  value: '8f4343466…dc327aa4',
};
try {
  const handle = ⟦await navigator.crossOriginStorage
    .getFileHandle(hash)⟧;
  const blob = await handle.getFile();
  // Use it. No download!
} catch (err) {
  // 'NotFoundError' β†’ Resource not cached
  // 'NotAllowedError' β†’ COS not allowed

  // Fetch the resource from the network.
}
Write to COS

const hash = {
  algorithm: 'SHA-256',
  value: '8f4343466…dc327aa4',
};
// `blob` holds the bytes, e.g., from `fetch()`.
try {
  const handle = await navigator.crossOriginStorage
    .getFileHandle(hash, {
      create: true,
      ⟦origins: '*'⟧, // or a list of origins
    });
  const writable = await handle.createWritable();
  await writable.write(blob);
  await writable.close();
} catch (err) {
  // 'DataError' β†’ Bytes don't match the hash
  // 'NotAllowedError' β†’ COS not allowed
}
Other integrations

Or just say it in markup

HTML

<script
  src="popular-js-framework.js"
  integrity="sha256-def456…"
  ⟦crossoriginstorage="*"⟧
></script>
CSS

@font-face {
  font-family: "Popular Emoji Font";
  src: url("popular-emoji.woff2"
    integrity("sha256-xyz789…")
    ⟦cross-origin-storage(*)⟧);
}
JS import attribute

import mod from 'popular-module.js' with {
  integrity: 'sha256-abc123…',
  ⟦crossOriginStorage: '*'⟧,
};
await import('popular-module.js', {
  with: { integrity: 'sha256-abc123…',
          ⟦crossOriginStorage: '*'⟧ },
});
fetch() API

const response = await fetch('popular-resource.ext', {
  integrity: 'sha256-abc123…',
  ⟦crossOriginStorage: '*'⟧,
});
Involving the bundler ecosystem from the start

A Vite plugin does the heavy lifting

At build time

vite-plugin-cross-origin-storage splits shared dependencies into chunks named by their SHA-256, so independent builds produce identical bytes.

Runtime loader

For each chunk in the manifest:
getFileHandle({ value: hash })

Works as progressive enhancement: without COS, every chunk is a miss.

Hit βœ“

Blob from COS β†’ blob: URL in the import map. Zero bytes over the network.

Miss

fetch(file, { integrity }), then store it with origins: '*' for the next site.

Developed and maintained by Nuxt logoNuxt

Live demo Β· two games, two sites

Without COS

Live demo Β· two games, two sites

With COS

<iframe allow="cross-origin-storage">
Live demo Β· Whisper Tiny (English)

AI models

whisper-tiny.en Β· Transformers.js Β· on the Public Hash List

import { pipeline, env } from '@huggingface/transformers';

⟦env.experimental_useCrossOriginStorage = true;⟧
const transcriber = await pipeline(
  'automatic-speech-recognition', 'onnx-community/whisper-tiny.en');
// Hit: no download. Miss: fetched, then stored in COS for every other site.
Live demo Β· Whisper Tiny (English)

Same model, another site

A dictation app on web-ai-community.github.io
Live demo Β· the Doto Web font

Web fonts

Doto Β· CSS cross-origin-storage(*) Β· on the Public Hash List

@font-face {
  font-family: "Doto";
  src: url("doto-latin.woff2"
    integrity("sha256-HH2fnIb5KftEabipNRCmWTbTvcSeChpoeK4rDz9Hx8I=")
    ⟦cross-origin-storage(*)⟧);
}
/* Hit: no download. Miss: fetched, checked against the hash,
   and stored in COS for every other site. */
Live demo Β· the Doto Web font

Same font, another site

A departure board on web-ai-community.github.io
Privacy

β€œIsn't this a πŸ¦Έβ€β™‚οΈπŸͺ supercookie?”

Tracker in an iframe

Access is keyed to the top-level site

A tracker iframe that stores a file on site A can't read it back on site B, like any partitioned storage.

Tracker as first-party script

Public Hash List

Cross-site sharing only for provably popular files. Everything else acts as absent and throws a NotFoundError.

Probing many hashes

Small cross-site lookup budget

Per top-level site, lasting weeks and shared by every iframe. Cheaper for large files like models.

Defaults

Global sharing is opt-in, same-site by default

Sharing with listed origins needs an HTTP header opt-in. Browsers may occasionally lie on purpose.

Ecosystem

Who wants this?

Hugging Face logoTransformers.jsHugging Face
● live
MLC AI logoWebLLMMLC AI
● live
ggml logowllamallama.cpp for the web
● live
LiteRT logoLiteRT-LM JSGoogle AI Edge
● open CL
Prebid logoPrebid.jsCDN distribution
● live
Flutter logoFlutterSkia Wasm runtime
● live
Nuxt logoNuxtVite plugin + nuxt-cos
● live
Google Fonts logoGoogle FontsWeb fonts
● internal partner
SQLite logoSQLite WasmSQLite in the browser
● live
Emscripten logoEmscriptenGenerated Wasm
● live

Built against the extension today, ready for a native API tomorrow.

Your turn: help us shape it

Try the Cross-Origin Storage API

Chromium logowith COSπŸ§ͺExperimental Chromium build with native COS
Chrome logoFirefox logoSafari logoExtension for Chrome, Firefox, Safari
πŸ“„WICG logoExplainer & spec
Awesome list badgeDemos, integrations, everything
Dogfooding

Everything this deck loads from COS

Web fonts Β· CSS cross-origin-storage(*)
Roboto (Latin)37.5 kB●
Doto (Latin)5.4 kB●
Noto Color Emoji, slice 3163.1 kB●
Noto Color Emoji, slice 5121.1 kB●
Noto Color Emoji, slice 6124.6 kB●
Noto Color Emoji, slice 7211.7 kB●
Noto Color Emoji, slice 8423.9 kB●
Libraries Β· import() and <script>
Transformers.js 4.4 (74c0878)619.1 kBβ—‹
chobitsu 1.8.6 (in-slide DevTools)457.9 kBβ—‹
qrcode-generator 2.0.451.9 kBβ—‹
browser-fs-access 0.38.05.9 kBβ—‹
Whisper Tiny (English) Β· Transformers.js
decoder_model_merged.onnx118.6 MB●
encoder_model.onnx32.9 MB●
tokenizer.json2.4 MB●
tokenizer_config.json282.7 kBβ—‹
config.json2.2 kBβ—‹
generation_config.json1.6 kBβ—‹
preprocessor_config.json0.3 kBβ—‹
ONNX Runtime Web 1.31 Β· Transformers.js
ort-wasm-simd-threaded.asyncify.wasm26.9 MBβ—‹
ort-wasm-simd-threaded.asyncify.mjs53.1 kBβ—‹
Three.js r183 Β· the games' Vite plugin
three.core chunk378.7 kBβ—‹
three.module chunk355.8 kBβ—‹

● On the Public Hash List: any site can read it from COS. β—‹ Not on the list: only the sites that stored it can.
22 files, 184.0 MB in total. 155.0 MB of it (84%) is on the Public Hash List.

Thank you!Let's talk.

Grab the slides and demos, and run them yourself.

Thomas Steiner
Thomas Steiner@tomayac on the InternetGoogle Chrome