I'm running into the same issue as https://github.com/facebookincubator/create-react-app/issues/966#issuecomment-271311044 when using SSE via a proxy.
Would it be possible to make the compression configurable via env?
Not strictly opposed to this, but can we somehow only restrict compression to the assets WDS serves, and not to anything proxied?
Until a solution arrives (like proposed by @gaearon), some may find it useful to work around the issue by adding a Cache-Control: no-transform HTTP header to the SSE server. This prevents the compression module from buffering and compressing the stream.
Closing as stale. If somebody wants to fix this please send a PR.
This has most certainly caused problems with Server-Sent-Events. I'm using this in my project, and have determined that the gzip compression is causing the event connection to close. I'm struggling to find a way to unset this - however, it's not clear to me why this change was made to default with compression enabled, since in a development environment it's a low-impact issue to have non-compressed files served. The trade-off of making SSE unusable doesn't seem to have been a good call.
Thanks.
@don-p as a quick workaround, setting Cache-Control: no-transform on the SSE call will force Webpack Dev Server not to compress/buffer up the content.
But I agree, enabling compression on Webpack Dev Server is low-impact.
Most helpful comment
Until a solution arrives (like proposed by @gaearon), some may find it useful to work around the issue by adding a
Cache-Control: no-transformHTTP header to the SSE server. This prevents the compression module from buffering and compressing the stream.