Removes flush_cache endpoint

This commit is contained in:
Raul Ochoa
2015-02-10 00:13:50 +01:00
parent a4eade31a2
commit 636591ecbb
2 changed files with 0 additions and 71 deletions
-9
View File
@@ -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 || {};
-62
View File
@@ -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