Dhango Channels message compression #2141
-
Hey there! Is there any native way to compress a socket message sent to through channels layers? Currently i'm manually doing it by using If anyone could give me any insight to this topic it would be very helpful |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You could use @simonw's ASGI gzip middleware, that was itself extracted from Starlette. https://github.com/simonw/asgi-gzip At a high-level, either the consumer needs to do it (which I assume is what you have currently) or an ASGI middleware, or maybe the protocol server (uvicorn/Daphne/etc). |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your help @carltongibson I will have a look to your suggestion |
Beta Was this translation helpful? Give feedback.
You could use @simonw's ASGI gzip middleware, that was itself extracted from Starlette.
https://github.com/simonw/asgi-gzip
At a high-level, either the consumer needs to do it (which I assume is what you have currently) or an ASGI middleware, or maybe the protocol server (uvicorn/Daphne/etc).