3

If not, are there any other alternative options to save bandwidth? If yes, is it done on a deeper layer such as a 3rd party nodejs module?

Dave
  • 12,117
  • 10
  • 46
  • 52
  • DDP messages are sent over SockJS, which doesn't use compression at the moment. For a suggestion on how to reducing loading times for sending tons of data, see http://stackoverflow.com/a/21835534/586086. – Andrew Mao May 09 '14 at 17:45
  • if sockjs uses xhr long polling with gzip, then they are compressed :) – imslavko May 09 '14 at 18:49

2 Answers2

0

To get a handle on DDP have a look at the amazing stuff Arunoda Susiripala has published recently

https://coderwall.com/p/rybkjg and http://meteorhacks.com/introduction-to-ddp.html.

These will give you a much better understanding.

Peter Nunn
  • 2,110
  • 3
  • 29
  • 44
  • 1
    Your current answer doesn't really address the question whether the DDP msgs are compressed over the wire. Andrew Mao's and imslavko's comments answer the question. So, if the msgs are using websockets, then they are not compressed. If polling is used, then it could be compressed with gzip. – Dave May 12 '14 at 03:47
0

Yes this is supported you just need to set env variable SERVER_WEBSOCKET_COMPRESSION to configuration needed by package they are using permessage-deflate. But you need to set there a parseable JSON.

All the options for this package are available here faye/permessage-deflate-node

So for example you can have var

SERVER_WEBSOCKET_COMPRESSION={"level":7, "maxWindowBits":13, "memLevel":7, "requestMaxWindowBits":13}

This is done by websocket extension which actually does the following operations on SERVER_WEBSOCKET_COMPRESSION as below:

var websocketExtensions = _.once(function () {
var extensions = [];

var websocketCompressionConfig = process.env.SERVER_WEBSOCKET_COMPRESSION
    ? JSON.parse(process.env.SERVER_WEBSOCKET_COMPRESSION) : {};
if (websocketCompressionConfig) {
extensions.push(Npm.require('permessage-deflate').configure(
  websocketCompressionConfig
));
}

return extensions;
});

So if your JSON is not passable your server will explode with an exception.

Luman75
  • 878
  • 1
  • 11
  • 28