问题
I was wondering what the current state of javascript based json compression is. Are there any libraries currently available that allow compressing json, either by replacing long names with single characters, or some other method?
回答1:
Someone has implemented HPack in Javascript, which could really improve JSON data set sizes, assuming your data set is homogeneous.
Since your emphasis is on transfer, rather than storage, don't forget to use things like gzip
and to minimise your JSON. Those should be the first steps before adding yet more compression overhead.
来源:https://stackoverflow.com/questions/11774375/json-compression-for-transfer