From 636591ecbb7533db9261310840fc26339f233b10 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 10 Feb 2015 00:13:50 +0100 Subject: [PATCH] Removes flush_cache endpoint --- lib/cartodb/cartodb_windshaft.js | 9 ----- test/acceptance/server.js | 62 -------------------------------- 2 files changed, 71 deletions(-) diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index f57248fa..063e0572 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -166,15 +166,6 @@ var CartodbWindshaft = function(serverOptions) { * END Routing ******************************************************************************************************************/ - /** - * Helper API to allow per table tile cache (and sql cache) to be invalidated remotely. - * Keep endpoint for backwards compatibility - */ - ws.del(serverOptions.base_url + '/flush_cache', function(req, res){ - ws.doCORS(res); - ws.sendResponse(res, [{status: 'ok'}, 200]); - }); - var healthCheck = new HealthCheck(cartoData, Windshaft.tilelive); ws.get('/health', function(req, res) { var healthConfig = global.environment.health || {}; diff --git a/test/acceptance/server.js b/test/acceptance/server.js index 8378c642..e02991a2 100644 --- a/test/acceptance/server.js +++ b/test/acceptance/server.js @@ -1177,68 +1177,6 @@ suite('multilayer:postgres=' + cdbQueryTablesFromPostgresEnabledValue, function( }); }); - ///////////////////////////////////////////////////////////////////////////////// - // - // DELETE CACHE - // - ///////////////////////////////////////////////////////////////////////////////// - - test("forbids flushing cache without specifying table name", function(done) { - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/flush_cache', - method: 'DELETE' - },{}, function(res) { - assert.equal(res.statusCode, 404, res.statusCode + ': ' + res.body); - assert.ok(!res.headers.hasOwnProperty('cache-control')); - done(); - }); - }); - - test("allows flushing table cache by unauthenticated user", function(done) { - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/gadm4/flush_cache', - method: 'DELETE' - },{}, function(res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - // TODO: also check that varnish is signalled (using VarnishEmu) - // NOTE: requires enable_cache=1 in test.js - done(); - }); - }); - - ///////////////////////////////////////////////////////////////////////////////// - // - // DELETE CACHE - // - ///////////////////////////////////////////////////////////////////////////////// - - test("forbids flushing cache without specifying table name", function(done) { - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/flush_cache', - method: 'DELETE' - },{}, function(res) { - assert.equal(res.statusCode, 404, res.statusCode + ': ' + res.body); - assert.ok(!res.headers.hasOwnProperty('cache-control')); - done(); - }); - }); - - test("allows flushing table cache by unauthenticated user", function(done) { - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/gadm4/flush_cache', - method: 'DELETE' - },{}, function(res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - // TODO: also check that varnish is signalled (using VarnishEmu) - // NOTE: requires enable_cache=1 in test.js - done(); - }); - }); - ///////////////////////////////////////////////////////////////////////////////// // // Tear down