From 7196c8c285e4e297e5c6a5c0333299d1e2261144 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 5 Oct 2012 16:55:58 +0200 Subject: [PATCH] Only invalidate cache on del style when caching is enabled --- lib/cartodb/cartodb_windshaft.js | 2 +- lib/cartodb/server_options.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index 69687eff..e4536a82 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -73,7 +73,7 @@ var CartodbWindshaft = function(serverOptions) { ws.doCORS(res); Step( function(){ - serverOptions.flushCache(req, Cache, this); + serverOptions.flushCache(req, serverOptions.cache_enabled ? Cache : null, this); }, function(err, data){ if (err){ diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index b65bf5da..a1682377 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -155,7 +155,9 @@ module.exports = function(){ }, function(err, data){ if (err) throw err; - Cache.invalidate_db(req.params.dbname, req.params.table); + if(Cache) { + Cache.invalidate_db(req.params.dbname, req.params.table); + } callback(null, true); } );