8 months ago
I have a Python web app that uses a compression middleware. The middleware supports Brotli and uses Gzip as a fallback. The responses are correctly compressed on my local machine, but when serving over Railway, they are served uncompressed.
2 Replies
8 months ago
Railway's proxy does not currently support proxying compressed requests and responses.
Not sure I understand. I found this related thread and they were using Brotli
8 months ago
yep, it was enabled and then decided later to be disabled again
8 months ago
we don't currently have any immediate plans that I'm aware of to enable this at the proxy level
8 months ago
when enabled our proxy has to do the compression and decompression for every request.
Was this announced? It's an important feature to support, compression would reduce my responses by ~80%
8 months ago
it was not announced
8 months ago
I'm sorry but it wasn't economical for us, in the future we may look into allowing the user's server and client do the compression instead of our proxy.
Ok, please bubble this up to the powers that be. I really love using railway, but I'm going to have to test some other service providers now
8 months ago
for context a beloved ex railway employee has asked for it, so we will likely be giving it a serious thought
Thanks. I really hope you guys can add back the support. Performance is important for me and my users
8 months ago
if we do add it back, it wouldn't be at the proxy level, your server and client would be responsible for compression.
8 months ago
that's correct
8 months ago
no need for a new thread, you can bump this thread -
the rest of the team will be back at work Tuesday, so expect some kind of answer there by EOW
8 months ago
no problem, going to solve this, please bring further discussion to that linked thread.
8 months ago
Brody, just to get it right, does this mean that even though my client is sending the correct Accept-encoding headers and I have a compression middleware in my nodejs server, the response won't be delivered as compressed?
I'm experiencing the same issue where the response gets correctly compressed when running my nodejs server locally, but when deployed in Railway the compression doesn't work nor the Content-Encoding header is present.
I'm not using any reverse proxy. Just the Nestjs server, with the compression middleware, and the client is just a react app using axios.
Is there a work around for this?
Thanks in advance.
8 months ago
that's correct, compression is disabled at the proxy level
8 months ago
Thanks for the response, Brody.
Is there any workaround for this? Is there any way that I can deploy my server on Railway and still be able to use compression for just the common uses of json, text or scripts?
8 months ago
as it has been disabled at the proxy level there would be no workaround.
please bump the linked thread made by greg.
8 months ago
@Railay - we have pushed a change, as long as your server code and client support compression, your responses will be compressed
8 months ago
read more about it here -