diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index fb424400..2c7820b0 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -9,8 +9,9 @@ var CartodbWindshaft = function(serverOptions) { // 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); - res.header('Last-Modified','Wed, 30 Aug 1978 00:00:00 GMT'); // special date in the past. - res.header('Cache-Control','no-cache,must-revalidate, public'); +// note - not invalidating properly +// res.header('Last-Modified','Wed, 30 Aug 1978 00:00:00 GMT'); // special date in the past. +// res.header('Cache-Control','no-cache,must-revalidate, public'); callback(null, tile, headers); }; diff --git a/lib/cartodb/varnish.js b/lib/cartodb/varnish.js index 977f5bdc..89f67e5f 100644 --- a/lib/cartodb/varnish.js +++ b/lib/cartodb/varnish.js @@ -51,7 +51,15 @@ function VarnishClient(host, port, ready_callback) { // sends the command to the server function _send(cmd, callback) { cmd_callback = callback; - client.write(cmd + '\n'); + + // If varnish down attempt simple reconnect + try{ + client.write(cmd + '\n'); + } catch(err) { + self.close(); + connect(); + client.write(cmd + '\n'); + } } // run command if there is no peding response