mikeal/filed

Add gzip support

Opened this issue · 4 comments

I love this module, but unfortunately, there's no good way to add zlib support without rewriting it. Would it be possible to add zlib support at some point in the future?

i'd take a patch, i'll need it eventually and write it myself :)

Shouldn't be too hard. I'll see what I can do. :-)

If #25 gets pulled then you can just pipe the filed stream to
oppressor like this:

var oppressor = require('oppressor');
var filed = require('filed');
var http = require('http');

var server = http.createServer(function (req, res) {
     filed(__dirname + '/data.txt')
        .pipe(oppressor(req))
        .pipe(res)
    ;
});
server.listen(8000);

Letting other libraries like oppressor handle compression is pretty much what pipes should be all about.

Any updates on this request ?