I'm building an iPhone app that's going to be sending and receiving large amounts of data to and from a server. I'm using JSon to get the data. I was wondering if it's possible to also use some sort of compression on the received data in order to try to speed up the process a little bit. If so, which kind of compression works best with JSon, and where can I find more info on it?
Thanks,
As text data, JSON data compresses nicely. That's why gzip is our first option to reduce the JSON data size. Moreover, it can be automatically applied in HTTP, the common protocol for sending and receiving JSON. Let's take the JSON produced with the default Jackson options and compress it with gzip.
Available in iOS 9.0+ and macOS 10.11+, Compression simplifies the process of leveraging a number of common compression algorithms such as ZLIB, LZMA, LZFSE, and LZ4.
late for party but just in case anyone looking for. Use ASIHTTPRequest which has inbuilt supports for the gzip compression. this will save overhead of handling decompression. gzip at ASIHTTPRequest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With