Skip to content

Commit 8ce48f7

Browse files
committed
app.js cleanup, cache defaults to 1 year for maxAge
1 parent afef373 commit 8ce48f7

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

app.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ mongoose.connection.on('error', function() {
5252
console.error('MongoDB Connection Error. Make sure MongoDB is running.');
5353
});
5454

55-
var hour = 3600000;
56-
var day = hour * 24;
57-
var week = day * 7;
58-
5955
/**
6056
* CSRF whitelist.
6157
*/
@@ -84,10 +80,7 @@ app.use(session({
8480
resave: true,
8581
saveUninitialized: true,
8682
secret: secrets.sessionSecret,
87-
store: new MongoStore({
88-
url: secrets.db,
89-
auto_reconnect: true
90-
})
83+
store: new MongoStore({ url: secrets.db, auto_reconnect: true })
9184
}));
9285
app.use(passport.initialize());
9386
app.use(passport.session());
@@ -111,7 +104,7 @@ app.use(function(req, res, next) {
111104
req.session.returnTo = req.path;
112105
next();
113106
});
114-
app.use(express.static(path.join(__dirname, 'public'), { maxAge: week }));
107+
app.use(express.static(path.join(__dirname, 'public'), { maxAge: 31557600000 }));
115108

116109
/**
117110
* Main routes.

0 commit comments

Comments
 (0)