diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index 195f00b6..568fc002 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -16,12 +16,18 @@ var CartodbWindshaft = function(serverOptions) { afterTileRender: lru_cache.afterTileRender, cacheStats: lru_cache.getStats, afterStateChange: lru_cache.afterStateChange - }) + }); } + // set the cache chanel info to invalidate the cache on the frontend server + serverOptions.afterTileRender = function(req, res, tile, headers, callback) { + res.header('X-Cache-Channel', req.params.dbname); + callback(null, tile, headers); + }; // boot var ws = new Windshaft.Server(serverOptions); + /** * Helper to allow access to the layer to be used in the maps infowindow popup. */