From 722705468fa140cd4211ed17ed45f29da2a8dcf8 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 14 Jul 2015 20:53:26 +0200 Subject: [PATCH] Not adding surrogate keys for empty affected tables --- lib/cartodb/controllers/named_maps.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index a0be85b7..6936332f 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -56,7 +56,9 @@ NamedMapsController.prototype.sendResponse = function(req, res, resource, header var tablesCacheEntry = new TablesCacheEntry(dbName, result.affectedTables); res.header('X-Cache-Channel', tablesCacheEntry.getCacheChannel()); - self.surrogateKeysCache.tag(res, tablesCacheEntry); + if (result.affectedTables.length > 0) { + self.surrogateKeysCache.tag(res, tablesCacheEntry); + } } self.app.sendResponse(res, [resource, 200]); }