compress.js doesn't seem to be working #31

Closed
goldfire opened this Issue May 3, 2012 · 2 comments

Projects

None yet

2 participants

@goldfire
goldfire commented May 3, 2012

I've tried on both Express 2.6.9 and 3.0.0alpha2 with Node 0.6.15, but when I view the inspector, only the static files are getting gzipped. What is interesting is that I also tried using the compress middleware that comes with Express 3, and I couldn't get that to work either.

My config:

app.configure(function(){
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.set('view options', {cache: true});
    app.use(express.bodyParser());
    app.use(express.cookieParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.staticCache());
    //app.use(express.static(__dirname + '/public'));
    //app.use(express.compress());
    app.use(gzippo.staticGzip(__dirname + '/public'));
    app.use(gzippo.compress());
});

Is there something else required outside of the configuration to make it work?

@tomgco
Owner
tomgco commented May 11, 2012

Have you tried placing the the compress commands before app.use(app.router);? I believe that is what I have on my sites, however it is possible it is not working for me?

@goldfire

Yes, that took care of it. Thank you very much!

@goldfire goldfire closed this May 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment