To try this demo, please follow these instructions:
- Use Chrome Canary or Dev (version > 117.0.5906.0).
-
Enable both chrome://flags/#enable-compression-dictionary-transport
and
chrome://flags/#enable-compression-dictionary-transport-backend
-
Open DevTools (Windows: F12 key, Mac: Command + Option + I), and select the Network tab.
-
Go to demo.html?r=151
-
Go to demo.html?r=152
- This page is using Three.js (revision 152).
- You can see "5.9 KB" in the network column of "152.js".
- This is compressed using Shared Brotli using the content of "151.js" as a dictionary. The original size of
"152.js" is 1,208,641 bytes. And the compressed data size is 5,612bytes.
-
When you click "152.js", you can see this new request header:
Available-Dictionary: :epjv6NymTtsZ63DPEBkyCVCh7ZlGicsjTPkBUvSQ9G4=:
Also you can see new "br-d" and "zstd-d" Accept-Encoding types:
Accept-Encoding: gzip, deflate, br, zstd, br-d, zstd-d
This request header means that the browser has a dictionary with the hash, and can use Shared Brotli
compression.
-
And the response header has
Content-Encoding: zstd-d
and Content-Dictionary: :epjv6NymTtsZ63DPEBkyCVCh7ZlGicsjTPkBUvSQ9G4=:
headers.
This means that the response is compressed using the dictionary.
-
Also, the response header contains the "Use-As-Dictionary" header.
Use-As-Dictionary: match="/js/*"
So the content of "152.js" will be used as a shared dictionary for fetching resources under "/js/".
- In chrome://net-internals/#sharedDictionary, you can
see the updated dictionary information.
-
Go to /demo.html?r=153
- This page is using Three.js (revision 153).
- You can see "4.3 KB" in the network column of "153.js".
- This is compressed using Shared Brotli using the content of "152.js" as a dictionary. The original size of
"153.js" is 1,223,960 bytes. And the compressed data size is 4,077 bytes.
- In chrome://net-internals/#sharedDictionary, you can
see the updated dictionary information.