Pergunta

In this FAQ question it says that compression is used automatically when the browser supports it and that I don't need to modify my application in any way.

My question is, does that apply to Channel API messages too?

I have an application that needs to send relatively large JSON (text) data through a persistent connection and I'm hoping I can get things through faster if they are compressed.

If not, I can think of a workaround to have the server send just a ping through the channel when a big load comes through and have the browser then make a GET request to fetch it (and that would "automatically" compress it), but that would add the latency of another request.

Foi útil?

Solução

Data sent over the connection the Channel API uses is gzip compressed.

However, Channel API messages are limited to 32K uncompressed, so for anything bigger than that you'll need to use the ping/GET method anyway.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top