pub fn maybe_compress(payload: &[u8]) -> CompressedPayloadExpand description
Compress a payload if it exceeds the threshold.
Returns CompressedPayload::Uncompressed if:
- Payload is below threshold
- Compression fails
- Compressed size is larger than original (unlikely for JSON)
Returns CompressedPayload::Compressed with raw gzip bytes if compression
is beneficial. The gzip data starts with magic bytes 0x1f 0x8b which clients
use to detect compression.