其他
Introduction
CompactJSON is a concept we developed in an effort to reduce the size of the JSON we were producing. We originally wanted to use Protocol Buffers, but it wouldn't work for us because we would need to deserialize it in Javascript, and we couldn't find a good solution for that that worked well.
We were sending JSON to the client that in some cases was 1.7MB uncompressed. After gzipping it, it's much, much smaller, but we were even having problems on the server because of the amount of memory involved in generating the JSON text.
We decided to "minify" the JSON being generated on the server by removing names and relying on its position in the JSON in order to recreate a proper object on the client side.
JSON used in this example
JSON normally looks like this:
var contactJSON = { "Name": "John Doe", "PermissionToCall": true, "PhoneNumbers": [
暂无评论