From d5e20ef558d182e99f58eaf2c644d2d67670cc4d Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 23 Mar 2015 18:40:59 +0100 Subject: [PATCH] Remove cache_policy query param --- lib/cartodb/server_options.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index d19dccb2..c6afe11e 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -11,7 +11,6 @@ var assert = require('assert'); // Whitelist query parameters and attach format var REQUEST_QUERY_PARAMS_WHITELIST = [ 'user', - 'cache_policy', 'callback', 'map_key', 'api_key', @@ -207,11 +206,7 @@ module.exports = function(redisPool) { req.profiler.start('addCacheChannel'); } var res = req.res; - var cache_policy = req.query.cache_policy; if ( req.params.token ) { - cache_policy = 'persist'; - } - if ( cache_policy == 'persist' ) { res.header('Cache-Control', 'public,max-age=31536000'); // 1 year } else { var ttl = global.environment.varnish.ttl || 86400; @@ -318,12 +313,8 @@ module.exports = function(redisPool) { if (req.res && req.method == 'GET') { var res = req.res; - if ( req.query && req.query.cache_policy == 'persist' ) { - res.header('Cache-Control', 'public,max-age=31536000'); // 1 year - } else { - var ttl = global.environment.varnish.layergroupTtl || 86400; - res.header('Cache-Control', 'public,max-age='+ttl+',must-revalidate'); - } + var ttl = global.environment.varnish.layergroupTtl || 86400; + res.header('Cache-Control', 'public,max-age='+ttl+',must-revalidate'); res.header('Last-Modified', (new Date()).toUTCString()); res.header('X-Cache-Channel', cacheChannel); }