demo · v142

Bundle Delta Savings

The deployment scenario Cloudflare and Google authors keep citing in the WICG thread: shared compression dictionaries for versioned JS bundles. Ship version N once; when version N+1 arrives it brotli-compresses against N as a dictionary and the user only downloads the delta. Slide the change rate to see how the wire size drops — and how the ttl parameter on the dictionary's Use-As-Dictionary header determines whether that path is still available next deploy.

brotli (no dictionary)

— KB

brotli + shared dictionary

— KB
—% savings on this deploy

dictionary response sent with version N

next bundle request

server response for version N+1

The Chrome 142 change is the addition of a configurable ttl= parameter inside Use-As-Dictionary. If the dictionary expires before the next deploy, Chrome stops advertising it and the server falls back to plain brotli — losing the savings on the right.

relevant headers

# Response when serving the dictionary asset (v1)
Use-As-Dictionary: match="/app/*.js", id="v1", type="raw", ttl=2592000

# Subsequent request for v2 includes:
Sec-Available-Dictionary: <sha-256 hash of v1>
Accept-Encoding: br, br-d, gzip

# Server replies with delta:
Content-Encoding: dcb
Sec-Dictionary-Id: v1

see also