At this moment SSE on chrome and firefox do not play well with compressed event-streams, even though the GET request from the browsers comes with "accept-encoding:gzip, deflate, br", the browsers do not trigger onmessage event anymore if the stream is compressed. So when using this module with any compression module like fastify-compress SSE stops working.
By adding "x-no-compression" header to the request eg:
Hi,
At this moment SSE on chrome and firefox do not play well with compressed event-streams, even though the GET request from the browsers comes with "accept-encoding:gzip, deflate, br", the browsers do not trigger onmessage event anymore if the stream is compressed. So when using this module with any compression module like fastify-compress SSE stops working.
By adding "x-no-compression" header to the request eg:
fixes the issue and the stream is uncompressed. I am talking about http2 on http1 it appears there is a little bit of workaround but might work (check the headers on this thread https://stackoverflow.com/questions/23769001/is-it-possible-to-use-gzip-compression-with-server-sent-events-sse - I tested the headers of suggested on stackoverflow and it does not work with http2)
I think the header x-no-compression should be added by default specially at least if the connection is http2
What do you think?
Thanks