压缩Json Javascript [英] Compressed Json Javascript
问题描述
目前我从Ajax发送JSON到服务器,然后使用Jackson Mapper将其转换为对象。
格式如下
{id:780710,folderID:42024,displayOrder:2},{id:780724 ,folderID:42024,displayOrder:3}
库来压缩这个数据,并且Jackson映射器能够处理新格式吗?
正如@JamWaffles所说,是最好的JSON能够做到关于压缩。
但是如果你有更大的响应,并且你想保存这些字节,有请查看
或
- msgpack 。
它们是不 JSON,但是它们将数据序列化为更小的格式/ p>
Currently I send JSON from an Ajax post to the server which is then converted to objects using the Jackson Mapper.
The format is like this
{"id":"780710","folderID":"42024","displayOrder":2},{"id":"780724","folderID":"42024","displayOrder":3}
What is the best JavaScript library to compress this data and will the Jackson mapper be able to handle the new format?
As said by @JamWaffles, this is the best JSON is able to do concerning compression. And in your case (the line of code you delivered), compressing further may be overkill.
But if you have larger responses, and you want to save those bytes, have a look at
or
They are not JSON, but they serialize data to a smaller format (in most cases).
这篇关于压缩Json Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!