|
|
@ -23,17 +23,5 @@ module.exports = function (middleware) {
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
next();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
middleware.addExpiresHeaders = function (req, res, next) {
|
|
|
|
|
|
|
|
if (req.app.enabled('cache')) {
|
|
|
|
|
|
|
|
res.setHeader('Cache-Control', 'public, max-age=5184000');
|
|
|
|
|
|
|
|
res.setHeader('Expires', new Date(Date.now() + 5184000000).toUTCString());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
res.setHeader('Cache-Control', 'public, max-age=0');
|
|
|
|
|
|
|
|
res.setHeader('Expires', new Date().toUTCString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|