Skip to main content
Whitespace between tokens is meaningless to a JSON parser, so removing it produces a smaller payload that parses to exactly the same value. For large request bodies, the saving is often 20% to 40%.

When it matters

  • Request and response bodies over slow or metered mobile connections
  • Bulk upload files, where the saving compounds across thousands of rows
  • Values stored in a database column or cache, where size is billed or capped

Minifying in code

Minify before signing, not after. The HMAC signature covers the exact bytes you transmit, so if you sign a formatted body and then minify it, verification fails. See Authentication.