Allow a different cache-control max-age for layergroup responses

This commit is contained in:
Raul Ochoa
2014-10-24 16:05:41 +02:00
parent ff4ec19fff
commit c88330f5f2
7 changed files with 55 additions and 5 deletions
+1 -1
View File
@@ -342,7 +342,7 @@ module.exports = function(redisPool) {
if ( req.query && req.query.cache_policy == 'persist' ) {
res.header('Cache-Control', 'public,max-age=31536000'); // 1 year
} else {
var ttl = global.environment.varnish.ttl || 86400;
var ttl = global.environment.varnish.layergroupTtl || 86400;
res.header('Cache-Control', 'public,max-age='+ttl+',must-revalidate');
}
res.header('Last-Modified', (new Date()).toUTCString());