Merge branch 'release/staging'

This commit is contained in:
Luis Bosque 2013-07-09 16:08:07 +02:00
commit 8b7cc64567
4 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,8 @@
1.3.2
------
* Set default layergroup TTL to 2 hours
* Server multilayer tiles and grid with persistent cache control
1.3.1
------
* Fix deadlock on new style creation

View File

@ -23,7 +23,7 @@ module.exports = function(){
datasource: global.environment.postgres,
cachedir: global.environment.millstone.cache_basedir,
mapnik_version: global.environment.mapnik_version || mapnik.versions.mapnik,
default_layergroup_ttl: 300 // seconds
default_layergroup_ttl: 7200 // seconds (defaultis 300)
},
mapnik: {
metatile: rendererConfig.metatile,
@ -210,6 +210,7 @@ module.exports = function(){
if ( req.method != 'GET' || ! req.res ) { cb(null, null); return; }
var res = req.res;
var cache_policy = req.query.cache_policy;
if ( req.params.token ) cache_policy = 'persist';
if ( cache_policy == 'persist' ) {
res.header('Cache-Control', 'public,max-age=31536000'); // 1 year
} else {

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "windshaft-cartodb",
"version": "1.3.1",
"version": "1.3.2",
"description": "A map tile server for CartoDB",
"url": "https://github.com/Vizzuality/Windshaft-cartodb",
"licenses": [{

View File

@ -92,8 +92,12 @@ suite('multilayer', function() {
assert.equal(res.statusCode, 200, res.body);
assert.equal(res.headers['content-type'], "image/png");
// Check Cache-Control
var cc = res.headers['cache-control'];
assert.equal(cc, 'public,max-age=31536000'); // 1 year
// Check X-Cache-Channel
var cc = res.headers['x-cache-channel'];
cc = res.headers['x-cache-channel'];
assert.ok(cc);
var dbname = 'cartodb_test_user_1_db'
assert.equal(cc.substring(0, dbname.length), dbname);