-
Notifications
You must be signed in to change notification settings - Fork 296
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
Add a note about gzip being incompatible with HMR #10
Comments
Hrm, this is annoying. I can add in some notes to say that SSE is involved. I'm not massively keen on implementing a non standard stream method. Does the gzip middleware return true/false to indicate buffering status on write()? Could pump extra bytes in until it indicates it was completed - or maybe get it to treat write("") as a flush? |
Perhaps https://github.com/jshttp/compressible shouldn't attempt to compress text/event-stream? |
I'm looking for a way to trick the compressor although I doubt there is a foolproof way. There's nothing wrong with compressing I agree that |
Perhaps @dougwilson could weigh in? How best to not break upstream buffering plugins without specifically coding for |
All we do is pump to the built-in |
One possibility is that we could, perhaps, change the default response filter to look for a |
That seems good to me and fits the semantics of |
Cool. Tracking issue: expressjs/compression#51 |
I can pick up doing a PR on both sides of no-one else beats me to it |
Also spent a couple hours tracking down this bug (twice, in fact, several weeks apart). :-) |
Added a troubleshooting note in 129de82, the new header is included in Will leave this bug open until that's merged too. |
Published to npm as |
If webpack-hot-middleware is installed after gzip middleware (like compression), no events will be sent as the buffers are not properly flushed.
This took a while to track down so it would be great if it were documented.
Alternatively, we can check for the existence of a
res.flush()
method and call it. This would make SSE work even if gzip is used. See expressjs/compression#17The text was updated successfully, but these errors were encountered: