Add gzip by default or option to enable it on Railway's edge proxy

Is it planned to enable gzip on Railway's new proxy by default or maybe an option to enable it? That would be a cool feature.

5 Replies

brody
EMPLOYEE

a year ago

What would the benefits be having the proxy do gziping Vs your application?


What would the benefits be having the proxy do gziping Vs your application?

It would be simpler to enable and I guess the gzip would be faster in a Go app (i guess the proxy is made in Go) than doing that in javascript + reduce any overhead that gzip may have in my application.


maddsua
HOBBY

a year ago

Might as well throw in brotli and zstd compression for good measure


20k-ultra
EMPLOYEE

a year ago

compression is pretty easy to get started, I can add gzip right now. But then when we start to introduce other compressions like brotli and zstd, there are latency trade offs which are not good for Railway user's since we don't cache anything at our edge so this latency cost is hit every time. We'd have to develop some heuristics to know given the content-type and accepted-encoding, which compression to use. We'd also want to allow user's to configure this themselves for their application in case our default settings are not good.

If we want to add decompression (client uploads something compressed) then it gets much trickier so we'll save that for another thread.


20k-ultra
EMPLOYEE

a year ago

I have something that implements gzip level 5 and brotli level 3. These are conservative levels (closer to 1 is faster with less compression). Should be able to merge tomorrow. Brotli is prioritized over gzip.

This is also just client to proxy. Not e2e.


Loading...