JSON is such a counter-intuitive wire format. Encode your large 32-bit integers as hex strings, and the wire size decreases!
Conversation
Replying to
If you were building the next next gzip, wonder what you could gain special-casing JSON (numbers become binary etc.) or XMLish syntax or whatever while still accepting any input and expanding back to the original bytes
1
1
2
(I mean, the existing next gzips are fine, saying this as idle curiosity not serious proposal.)
1
1
Brotli has a standard static dictionary based on web content and is the modern transparent compression algorithm for browsers.
WOFF2 font compression uses Brotli with content aware pre-processing / coding to substantially improve compression over WOFF1:
w3.org/TR/WOFF2/
2
2
Yep, know about WOFF2, Brotli and the static dictionary, and appreciate the work, wasn't trying to detract from any of that by speculating :)
1
1
Not trying to say you were detracting from it but rather bring up that what you suggested is not only completely valid but being used for WOFF2. Content aware pre-processing for JSON by converting it to a compression friendly binary format would be the same concept.
Ah, yeah, syntax-aware compression via a pre-transform would be interesting. (My bad for misparsing, Twitter's hard heh!)


