Json压缩传输 [英] Json compression for transfer

查看:816
本文介绍了Json压缩传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道基于javascript的json压缩的当前状态是什么。有没有任何目前可用的库允许压缩json,通过用单个字符替换长名称或一些其他方法?

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?

推荐答案

有人在HPScript in Javascript 中执行,这可以真正提高JSON数据集大小,假设你的数据集是同质的。

Someone has implemented HPack in Javascript, which could really improve JSON data set sizes, assuming your data set is homogeneous.

由于你的重点是转移,而不是存储,不要忘记使用像 gzip 并最小化您的JSON。这些应该是添加更多压缩开销之前的第一步。

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.

这篇关于Json压缩传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆