question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compression in webpack-dev-server

See original GitHub issue

Is there a reason that compress key is not set in WebpackDevServer config? I tried it on my machine and it made reloads faster and bandwidth usage smaller without any apparent problems.

I can send a PR if that’s okay.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
cloudmucommented, Jan 9, 2017

FYI, an unexpected consequence of webpack dev server compression is that Server Sent Events over proxy would be buffered, instead of proxied instantaneously.

The issue goes away in production mode, or if I set the webpack dev server compress flag to be false in dev mode.

I bet there are some tricks that would allow compression on without affecting Server Sent Events, but I haven’t figured it out yet.

2reactions
don-pcommented, Dec 14, 2018

FYI, an unexpected consequence of webpack dev server compression is that Server Sent Events over proxy would be buffered, instead of proxied instantaneously.

The issue goes away in production mode, or if I set the webpack dev server compress flag to be false in dev mode.

I bet there are some tricks that would allow compression on without affecting Server Sent Events, but I haven’t figured it out yet.

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

DevServer - webpack
webpack -dev-server can be used to quickly develop an application. See the development ... Enable gzip compression for everything served: webpack.config.js
Read more >
Enable gzip compression on webpack-dev-server?
To configure it in your web pack config, use the compression module. "devServer": { compress: true, before(app) { app.use(compression({})); } ...
Read more >
Option to disable the compression for the webpack dev server
Currently the compression is always activated for the webpack dev server. Currently this is a problem if you want to proxy chunked responses ......
Read more >
Webpack - Ep. 22 - Web Compression with GZip and Brotili
Last but probably most helpful are 2 technologies for compressing ... webpack Tutorial: devServer & Hot Module Replacement (Live Reload).
Read more >
webpack-dev-server - npm
--no-history-api-fallback Do not fallback to /index.html for Single Page Applications. --compress Enable gzip compression. --no-compress Disable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found