Zlib/deflate doesn’t exactly support shared dictionaries but you can “pre-load” the output stream with up to 32kB of data. For example in Python:
>>> from zlib import compressobj
>>> c = compressobj(zdict="abcdefghijklmnopqrstuvwxyz")
>>> c.compress(b"abcdefghijklmnopqrstuvwxyz")
b'xxbbx90x86x0b '
>>> c.flush()
b'Kxc4)x03x00x90x86x0b '
The output is a lot shorter than without the dictionary:
>>> compress(b"abcdefghijklmnopqrstuvwxyz")
b'xx9cKLJNIMKxcfxc8xccxcaxcexc9xcdxcb/(,*.)-+xafxa8xacx02x00x90x86x0b '
The question is: is there any way to decompress the dictionary-compressed output in Javascript using built in web APIs?
I’m 99% sure the answer is no; just checking I haven’t missed something.