Action Cable payload size limit


Is there a size limit for a message sent by an Action Cable?

Hello! I am also wondering the same thing.

I don’t believe that ActionCable has a payload size limit, but the adapter does.

I can speak from experience using the Postgres ActionCable Adapter. The limit is 8kb. Calling ActionCable.server.broadcast with a larger payload will raise PG::InvalidParameterValue: ERROR: payload string too long.

Note, my recommended pattern here for large payloads would be

  1. Send a message saying there is new data, with a CDN url

  2. Have client retrieve data from the CDN

If the data is secret then use the same pattern but without CDN

1 Like