How to compress json array list in java(Spring mvc) and decompress it in javascript(angular js) ? Have tried to gzip json by adding a filter in java but json data size is still the same in response.
Asked
Active
Viewed 1,096 times
1
-
Would this QnA help? [http://stackoverflow.com/questions/20676831/how-to-compress-json-in-java-and-decompression-in-javascript][1] [1]: http://stackoverflow.com/questions/20676831/how-to-compress-json-in-java-and-decompression-in-javascript – darko Jun 13 '15 at 13:54
-
Can you show us what you have tried? (Also, this smells of premature optimization. Do you actually NEED to compress the String?) – folkol Jun 13 '15 at 13:55
-
Isn't your server already serving gzipped responses? – Dave Newton Jun 13 '15 at 13:56
-
1In Tomcat server have enabled gzip compression its working for js,html,css files but application/json responses are not compressed – Siddharth Jun 13 '15 at 14:05
-
I remember, a long time ago, something called [`hpack`](https://github.com/WebReflection/json.hpack) and [`jsonpack`](https://github.com/sapienlab/jsonpack). It was available in a number of languages. – Xotic750 Jun 13 '15 at 14:28
-
@ Xotic750 My idea to compress json data is decrease the loading time as the json data size is more than 6 mb I had a look at jsonpack its a JavaScript program to pack and unpack JSON data so after loading its no point of compressing the data in javascript. I want something that compresses json data in java and decompresses it in javascript – Siddharth Jun 14 '15 at 13:39