Re:Ask HN: Is there a way to compress repeated JSON objects?
by Herostwist on Tuesday July 05, 2016 @10:10AM
(#12036515)
If this is for a public api i would simply enable gzip and call it a day.
if this is for internal use you have a few options. although there is automatic way of reusing or referencing objects within json you can construct your own model using references.
One technique i have used in the past for a smaller memory footprint is to have an data array and then reference index positions within it.
if this is for internal use you have a few options. although there is automatic way of reusing or referencing objects within json you can construct your own model using references.
One technique i have used in the past for a smaller memory footprint is to have an data array and then reference index positions within it.
e.g.
If you are free to use alternative serialisation methods i would recommend you look at protocol buffers.https://developers.google.com/protocol-buffers/