Discussion

Ask HN: Is there a way to compress repeated JSON objects?

Lets say you have a JSON:

  {
    "items": [
    {
      "foo": "foo bar",
      "bar": {
        "desc": "some really long data",
        "other": "lots more data"
      }
    },
    {
      "foo": "not foobar",
      "bar": {
        "desc": "some really long data",
        "other": "lots more data"
      }
    }]
  }
Where 'bar' is usually the same in every item. Is there a system of compressing json to use pointers or something so the 'bar' objects aren't repeated and only use a reference to the data?
3 points lonelycoder2 10 years ago 7 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton