From f6d50fafb14ecc5a73f1922a96f5db5355c9a841 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 25 Feb 2013 16:53:57 +0100 Subject: [PATCH] Expose renderer settings in the environment config files These are: metatile, bufferSize and cache_ttl --- NEWS.md | 1 + config/environments/development.js.example | 6 ++++++ config/environments/production.js.example | 6 ++++++ config/environments/staging.js.example | 6 ++++++ config/environments/test.js.example | 6 ++++++ lib/cartodb/server_options.js | 14 ++++++++++++++ 6 files changed, 39 insertions(+) diff --git a/NEWS.md b/NEWS.md index 28a9c773..066bd6f1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ----- * Do not let /etc/services confuse FD checker (munin plugin) * Multilayer support (#72) +* Expose renderer settings in the environment config files 1.1.6 (19//02//13) ----- diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 1d97b1dd..9c8c10f8 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -29,6 +29,12 @@ var config = { max_size: 500 } ,mapnik_version: undefined + ,renderer: { + // Milliseconds since last access before renderer cache item expires + cache_ttl: 60000, + metatile: 4, + bufferSize: 64 + } ,millstone: { cache_basedir: '/tmp/cdb-tiler-dev/millstone-dev' } diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 42a9dd3e..5ee29407 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -23,6 +23,12 @@ var config = { max_size: 500 } ,mapnik_version: undefined + ,renderer: { + // Milliseconds since last access before renderer cache item expires + cache_ttl: 60000, + metatile: 4, + bufferSize: 64 + } ,millstone: { cache_basedir: '/home/ubuntu/tile_assets/' } diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index cd89f527..7fc660c5 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -23,6 +23,12 @@ var config = { max_size: 500 } ,mapnik_version: undefined + ,renderer: { + // Milliseconds since last access before renderer cache item expires + cache_ttl: 60000, + metatile: 4, + bufferSize: 64 + } ,millstone: { cache_basedir: '/home/ubuntu/tile_assets/' } diff --git a/config/environments/test.js.example b/config/environments/test.js.example index e7221704..b97b9a6d 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -23,6 +23,12 @@ var config = { max_size: 500 } ,mapnik_version: '2.0.2' + ,renderer: { + // Milliseconds since last access before renderer cache item expires + cache_ttl: 60000, + metatile: 4, + bufferSize: 64 + } ,millstone: { cache_basedir: '/tmp/cdb-tiler-test/millstone' } diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 4fc5123f..ac9c458f 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -6,6 +6,13 @@ var _ = require('underscore') ; module.exports = function(){ + + var rendererConfig = _.defaults(global.environment.renderer || {}, { + cache_ttl: 60000, + metatile: 4, + bufferSize: 64 + }); + var me = { base_url: '/tiles/:table', base_url_notable: '/tiles', @@ -14,6 +21,13 @@ module.exports = function(){ cachedir: global.environment.millstone.cache_basedir, mapnik_version: global.environment.mapnik_version || mapnik.versions.mapnik }, + mapnik: { + metatile: rendererConfig.metatile, + bufferSize: rendererConfig.bufferSize + }, + renderCache: { + ttl: rendererConfig.cache_ttl + }, redis: global.environment.redis, enable_cors: global.environment.enable_cors, varnish_host: global.environment.varnish.host,