What is the best way to use gzip with websockets on Ionic?


#1

Hi there,

I receive large json via websocket and want to compress it by gzip on server side
What is the best way to use gzip with websockets on Ionic?

I found some solutions:

  1. Pako
    http://nodeca.github.io/pako/ (seems to working well)

  2. https://github.com/Apreta/cordova-plugin-zlib
    (documentation is none. Probably, I can build plugin for ionic, but don’t want waste my time )

  3. Used specific headers:
    Content-encoding: gzip
    Accept-encoding: gzip, deflate, sdch, br
    (I’m not sure this approach will be working with ionic on the all devices)