压缩Json Javascript [英] Compressed Json Javascript

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

问题描述

目前我从Ajax发送JSON到服务器,然后使用Jackson Mapper将其转换为对象。



格式如下

  {id:780710,folderID:42024,displayOrder:2},{id:780724 ,folderID:42024,displayOrder:3} 

库来压缩这个数据,并且Jackson映射器能够处理新格式吗?

解决方案

正如@JamWaffles所说,是最好的JSON能够做到关于压缩。



但是如果你有更大的响应,并且你想保存这些字节,有请查看









它们是 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屋!

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