Skip to content

Commit

Permalink
app.js cleanup, cache defaults to 1 year for maxAge
Browse files Browse the repository at this point in the history
  • Loading branch information
sahat committed Oct 28, 2014
1 parent afef373 commit 8ce48f7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app.js
Expand Up @@ -52,10 +52,6 @@ mongoose.connection.on('error', function() {
console.error('MongoDB Connection Error. Make sure MongoDB is running.');
});

var hour = 3600000;
var day = hour * 24;
var week = day * 7;

/**
* CSRF whitelist.
*/
Expand Down Expand Up @@ -84,10 +80,7 @@ app.use(session({
resave: true,
saveUninitialized: true,
secret: secrets.sessionSecret,
store: new MongoStore({
url: secrets.db,
auto_reconnect: true
})
store: new MongoStore({ url: secrets.db, auto_reconnect: true })
}));
app.use(passport.initialize());
app.use(passport.session());
Expand All @@ -111,7 +104,7 @@ app.use(function(req, res, next) {
req.session.returnTo = req.path;
next();
});
app.use(express.static(path.join(__dirname, 'public'), { maxAge: week }));
app.use(express.static(path.join(__dirname, 'public'), { maxAge: 31557600000 }));

/**
* Main routes.
Expand Down

0 comments on commit 8ce48f7

Please sign in to comment.