From 76c056c7a17c343b40e1663cd90d4aa0accb3f6e Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 15 Jul 2013 13:14:06 +0200 Subject: [PATCH] Revert "Use a constant Last-Modified time with cache_policy=persist" This reverts commit 4b5899ff1aec8c6682585bd2789179da3eed40d2. The reason is that setting Last-Modified to a remote date in the past triggers early expiration of cache (as max-age will be reached sooner) --- lib/cartodb/server_options.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 33fe8e87..86c607f3 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -213,20 +213,18 @@ module.exports = function(){ if ( req.params.token ) cache_policy = 'persist'; if ( cache_policy == 'persist' ) { res.header('Cache-Control', 'public,max-age=31536000'); // 1 year - // Set Last-Modified header to a constant time in the past - res.header('Last-Modified', new Date(0).toUTCString()); } else { var ttl = global.environment.varnish.ttl || 86400; res.header('Cache-Control', 'no-cache,max-age='+ttl+',must-revalidate, public'); - // Set Last-Modified header - // - // Currently sets it to NOW - // - // TODO: find out a real value, querying for most recent change in - // any of the source tables - res.header('Last-Modified', new Date().toUTCString()); } + // Set Last-Modified header + // + // Currently sets it to NOW + // + // TODO: find out a real value, querying for most recent change in + // any of the source tables + res.header('Last-Modified', new Date().toUTCString()); me.generateCacheChannel(req, function(err, channel){ if ( ! err ) {