Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compression in webpack-dev-server configurable #1633

Closed
chrsan opened this issue Feb 24, 2017 · 5 comments · May be fixed by #13205
Closed

Make compression in webpack-dev-server configurable #1633

chrsan opened this issue Feb 24, 2017 · 5 comments · May be fixed by #13205

Comments

@chrsan
Copy link

chrsan commented Feb 24, 2017

I'm running into the same issue as #966 (comment) when using SSE via a proxy.

Would it be possible to make the compression configurable via env?

@gaearon
Copy link
Contributor

gaearon commented Feb 24, 2017

Not strictly opposed to this, but can we somehow only restrict compression to the assets WDS serves, and not to anything proxied?

@knneth
Copy link

knneth commented Apr 4, 2017

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.

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

Closing as stale. If somebody wants to fix this please send a PR.

@gaearon gaearon closed this as completed Jan 8, 2018
JasoonS added a commit to JasoonS/node-ssestream that referenced this issue Aug 11, 2018
This is needed for proxies that interfere with the request (such as caching). This was the case with the `create-react-app`, when proxying requests to the dev-server backend to your real backend. See this issue: facebook/create-react-app#1633 (comment) . Maybe this header isn't always desired, but I didn't know a good way to make this configurable other than passing a 3rd argument to this `pipe` function, or maybe an extra parameter to the constructor allowing users to overwrite some of these headers if they want.
@don-p
Copy link

don-p commented Dec 14, 2018

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.

@compulim
Copy link

@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.

@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants