Websocket compression (e.g. gzip, zlib)

Has anyone tried Yjs with compression over websocket?

e.g. something like GitHub - nodeca/pako: high speed zlib port to javascript, works in browser & node.js in conjunction with y-websocket?

I recently noticed that because my yjs docs are so repetitive they are highly compressible and I’d love to be able to take advantage of that to speed up 3D world loading time.

My understanding is that compression is relatively expensive and a lot of frameworks don’t deal with it very well.

WebSockets support compression natively. The ws library, that y-websocket uses, can be configured to accept compression. If you want to enable compression, I suggest that you do it there because (I believe) compression is handled in a background thread.