From 78d415569d06d9fa093649d9b7cca248a1806f13 Mon Sep 17 00:00:00 2001 From: Simon Tokumine Date: Fri, 9 Dec 2011 00:32:32 +0000 Subject: [PATCH] pin to mapnik 2.0, enable passing style via url --- lib/cartodb/cartodb_windshaft.js | 5 ++--- lib/cartodb/server_options.js | 2 +- package.json | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index 838b4340..2d8f4ac6 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -2,16 +2,15 @@ var _ = require('underscore') , Step = require('step') , Windshaft = require('windshaft') - , Cache = require('./cache_validator') + , Cache = require('./cache_validator'); 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); - // note - may not be invalidating properly res.header('Last-Modified', new Date().toUTCString()); - res.header('Cache-Control', 'no-cache,max-age=3600,must-revalidate, public'); + res.header('Cache-Control', 'no-cache,max-age=86400,must-revalidate, public'); callback(null, tile, headers); }; diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index e37c2c5e..39f15498 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -22,7 +22,7 @@ module.exports = function(){ me.req2params = function(req, callback){ // Whitelist query parameters and attach format - var good_query = ['sql', 'geom_type', 'cache_buster','callback', 'interactivity', 'map_key']; + var good_query = ['sql', 'geom_type', 'cache_buster','callback', 'interactivity', 'map_key', 'style']; var bad_query = _.difference(_.keys(req.query), good_query); _.each(bad_query, function(key){ delete req.query[key]; }); diff --git a/package.json b/package.json index e6e54e03..cdd6ac2b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "0.0.1", + "version": "0.1.0", "description": "A map tile server for CartoDB", "url": "https://github.com/Vizzuality/Windshaft-cartodb", "licenses": [{ "type": "Copyright Vizzuality" }], @@ -16,7 +16,7 @@ }, "dependencies": { "underscore" : "1.1.x", - "windshaft" : "0.3.2", + "windshaft" : "0.4.1", "step": "0.0.x", "generic-pool": "1.0.x", "redis": "0.6.7",