Skip to content

Commit

Permalink
add gzip compression
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Dec 31, 2012
1 parent 91cb957 commit 4f41294
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/express.js
Expand Up @@ -11,6 +11,14 @@ var express = require('express')
module.exports = function (app, config, passport) {

app.set('showStackError', true)
// should be placed before express.static
app.use(express.compress({
filter: function (req, res) {
console.log(res.getHeader('Content-Type'));
return /json|text|javascript|css/.test(res.getHeader('Content-Type'));
},
level: 9
}))
app.use(express.static(config.root + '/public'))
app.use(express.logger('dev'))

Expand Down

0 comments on commit 4f41294

Please sign in to comment.