I use Channels & websockets for my webapp's "export data" functionality, since it can take a long time to generate the file (more than 30 seconds). In general this works fine, even for large downloads (several MB), but I have seen several cases on Heroku where the browser never receives the message with the file, even though debugging shows that JsonWebsocketConsumer.send was called as expected.
I found
this Github issue that says the message limit is 1 MB (or maybe 256 kb). My questions:
- Where is this limit defined? I searched the source of Channels and Daphne. I'm trying to figure out where the failure is happening -- in the worker, Daphne, or Redis.
- What happens if the limit is exceeded? Is an exception raised? (Because in my case it fails silently.)
- Is there really a 1 MB limit? Because it seems I have been able to send files larger than that using channels/asgi_redis (unfortunately I'm still on channels 0.17.3, can't upgrade yet because of a Twisted bug).
Thanks!