Encoding with Gzip and Zstd

Should i encode tiny API responses? Something like only single or couple json objects ( { “msg”: true } )

I guess encoding a tiny response especially with gzip will increase response length. Am i right?

If yes, which algorithm/algorithms should i use?

I think if small responses are not overwhelming majority of your traffic you don’t really need to worry about them. Just enable encoding and don’t worry about it too much. :slight_smile:

3 Likes

The encode middleware already will not compress small responses. Its threshold is currently 512 bytes.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.