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); } );