Compression

Supported by

 

  TsgcWebSocketServer

  TsgcWebSocketHTTPServer

  TsgcWebSocketClient

  Web Browsers like Chrome

 

 

This is a feature that works very well when you need to send a lot of data, usually using a binary message, because it compresses WebSocket message using protocol "PerMessage_Deflate" which is supported by some browsers like Chrome.

 

To enable this feature, you need to activate the following property:

 

  Extensions/ PerMessage_Deflate / Enabled

 

 

When a client tries to connect to a WebSocket Server and this property is enabled, it sends a header with this property enabled, if Server has activated this feature, it sends a response to the client with this protocol activated and all messages will be compressed, if Server doesn't have this feature, then all messages will be sent without compression.

 

On Web Browsers, you don't need to do anything, if this extension is supported it will be used automatically, if not, then messages will be sent without compression.

 

If WebSocket messages are small, is better don't enable this property because it consumes cpu cycle to compress/decompress messages, but if you are using a big amount of data, you will notify and increase on messages exchange speed.