JSON Data Size

Hello. I’m looking as ProseMirror to replace an old HTML editor. My biggest concern is the size of the JSON that ProseMirror generates compared to the HTML that it renders. When we use ProseMirror’s basic schema, our data is being inflated between 150%-250% depending on its complexity.

I’ve found prosemirror-compress & gotten some improvement. I can also use gzip or other compression to get a size that’s only ~130% of its equivalent html.

Are there best practices when serializing content relating to its size? Is there a more concise format that i can consider? Or am i thinking about this the wrong way?

Thank you for your help.

A simple example: HTML (26 bytes):

<p>foo bar <b>baz</b></p>

Turns into this JSON, (186 bytes):

{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        {
          "text": "foo bar ",
          "type": "text"
        },
        {
          "text": "baz",
          "type": "text",
          "marks": [
            {
              "type": "strong"
            }
          ]
        }
      ]
    }
  ]
}

It’s also perfectly viable to save your document in HTML form, if that works better for you.