SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Allow HTTP POST requests to use compression

Open jdetter opened this issue 1 year ago • 2 comments

We've recently discovered that there's a post body maximum size of 2MB. We'd like to increase this value, but there are some security implications to doing this: https://docs.rs/axum/latest/axum/extract/index.html#request-body-limits

So, another way we can allow users to invoke reducers with large parameters would be to use compression. Since these are calls over the HTTP interface and not through websockets we care less about performance so we could go with something that yields a higher compression ratio.

jdetter avatar Jun 03 '24 13:06 jdetter

Rate limiting calls over the HTTP API could also be a valid alternative. It would reduce the risk associated with increasing the max DefaultBodyLimit.

Lethalchip avatar Jun 12 '24 08:06 Lethalchip

I believe brotli will be a good choice for payload compression as it provides good compression ratio and processing time than other available choices. Can I contribute to this issue ?

P1YU5H-50N1 avatar Mar 08 '25 16:03 P1YU5H-50N1