Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scalableminds/webknossos into pri…
Browse files Browse the repository at this point in the history
…cing

* 'master' of github.com:scalableminds/webknossos:
  Disable compression for development proxy (#6699)
  • Loading branch information
hotzenklotz committed Dec 15, 2022
2 parents 22954d3 + 175a01b commit 067cf5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/proxy/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ function toWebpackDev(req, res) {
proxy.web(req, res, { target: `http://127.0.0.1:${PORT + 2}` });
}

proxy.on("proxyReq", (proxyReq, req) => {
if (req.url.match(/\/assets\/bundle\/.+\.js/)) {
// Disable compression for JS files, as the performance penalty of the compression
// isn't worth the size gain.
proxyReq.removeHeader("Accept-Encoding");
}
});

app.all("/assets/bundle/*", toWebpackDev);
app.all("/*", toBackend);

Expand Down

0 comments on commit 067cf5a

Please sign in to comment.