Skip to content

Commit

Permalink
feat(web-server): disable gzip compression
Browse files Browse the repository at this point in the history
With big files, the gzip compression is causing to serve only parts (chunks) of a file, as browser probably cancels the request at some timeout.

See #778 for a discussion. I saw similar issues on AngularJS build couple of times too.

Doing gzip compression on the fly is not a good idea. The compress module is more likely to be removed from express/connect.

If we wanna do gzip compression, we should probably do it as a preprocessor, so that it happens only once per file.
  • Loading branch information
vojtajina committed Dec 3, 2013
1 parent 969080b commit 5ee886b
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/web-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,9 @@ var createWebServer = function(injector, emitter) {
filesPromise: ['value', filesPromise]
}]);

// TODO(vojta): remove if https://github.com/senchalabs/connect/pull/850 gets merged
var compressOptions = {
filter: function(req, res){
return (/json|text|javascript|dart/).test(res.getHeader('Content-Type'));
}
};

var proxyMiddlewareInstance = injector.invoke(proxyMiddleware.create);

var handler = connect()
.use(connect.compress(compressOptions))
.use(injector.invoke(runnerMiddleware.create))
.use(injector.invoke(karmaMiddleware.create))
.use(injector.invoke(sourceFilesMiddleware.create))
Expand Down

0 comments on commit 5ee886b

Please sign in to comment.