Hi I am trying to use Server Sent Events.
I want to send chunked responses.
I am able to send them like so
conn
|> put_resp_header("cache-control", "no-cache")
|> put_resp_header("connection", "keep-alive")
|> put_resp_header("content-type", "text/event-stream;")
|> send_chunked(200)
|> chunk("This is some respsonse")
The responses are being sent, but without gzip compression.
How do i get responses to be sent with gzip compression?
I am using the latest phoenix with latest bandit.
Please advise.
PS If I don’t send chunked response, it gets compressed. For ex -
conn
|> put_resp_header("cache-control", "no-cache")
|> put_resp_header("connection", "keep-alive")
|> put_resp_header("content-type", "text/event-stream;")
|> text("This would get compressed")
Is some magic happening in the text/2 method?