Performance Optional
Use shared dictionaries for big bundles
For large bundles that change often, consider shared compression dictionaries. Small sites gain little.
How to do it
Serve Use-As-Dictionary on the old version of a large, often updated bundle. Then serve the new version compressed against it (dcb, dcz) at the CDN. Skip it for small bundles.
Example
HTTP/1.1 200 OK
Content-Type: text/javascript
Use-As-Dictionary: match="/app.*.js"
GET /app.new.js HTTP/1.1
Available-Dictionary: :<base64 SHA-256 of the old file>:
Accept-Encoding: gzip, br, zstd, dcb, dcz
HTTP/1.1 200 OK
Content-Encoding: dcb
Vary: Accept-Encoding, Available-Dictionary
How to check
In the browser's network panel, the new bundle shows Content-Encoding: dcb or dcz, and far fewer bytes than with Brotli alone.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/performance/compression-dictionary-transport.