Assuming you are retrieving this data through HTTP, is there any reason you cannot do this at the HTTP level? (See this article for information on HTTP compression .)
This way you do not need to do anything on the client side, except to make sure that the request contains the appropriate header Accept-Encoding. Depending on your server, you can simply configure some server settings to automatically get compression on this side ...
To be honest, it’s worth snatching WireShark to accurately check what happens up and down the wire. Perhaps you already got compression without knowing it :)
source
share