From f7c680d534129588dddbbe4e91dfa356d9a87b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?= Date: Wed, 9 Dec 2020 14:12:26 +0100 Subject: [PATCH] Update the Cache-Control header --- api/tiles/soc-experimental-timeseries.js | 2 +- api/tiles/soc-stock-future-period.js | 2 +- api/tiles/soc-stock-historic-period.js | 2 +- api/tiles/soc-stock-recent-timeseries.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/tiles/soc-experimental-timeseries.js b/api/tiles/soc-experimental-timeseries.js index 4c7e56d..1a4a049 100644 --- a/api/tiles/soc-experimental-timeseries.js +++ b/api/tiles/soc-experimental-timeseries.js @@ -34,7 +34,7 @@ const CONCENTRATION_RAMP = ` const sendImage = (res, z, data) => { res.set('Content-Type', 'image/png'); - if (z < 5) { + if (+z <= 5) { res.set('Cache-Control', 'public,max-age=604800'); } return res.send(Buffer.from(data)); diff --git a/api/tiles/soc-stock-future-period.js b/api/tiles/soc-stock-future-period.js index 2158d0a..98b46ae 100644 --- a/api/tiles/soc-stock-future-period.js +++ b/api/tiles/soc-stock-future-period.js @@ -32,7 +32,7 @@ const RAMP = ` const sendImage = (res, z, data) => { res.set('Content-Type', 'image/png'); - if (z < 5) { + if (+z <= 5) { res.set('Cache-Control', 'public,max-age=604800'); } return res.send(Buffer.from(data)); diff --git a/api/tiles/soc-stock-historic-period.js b/api/tiles/soc-stock-historic-period.js index b6481ae..194174d 100644 --- a/api/tiles/soc-stock-historic-period.js +++ b/api/tiles/soc-stock-historic-period.js @@ -63,7 +63,7 @@ const RAMP = { const sendImage = (res, z, data) => { res.set('Content-Type', 'image/png'); - if (z < 5) { + if (+z <= 5) { res.set('Cache-Control', 'public,max-age=604800'); } return res.send(Buffer.from(data)); diff --git a/api/tiles/soc-stock-recent-timeseries.js b/api/tiles/soc-stock-recent-timeseries.js index d5c498b..fa3048e 100644 --- a/api/tiles/soc-stock-recent-timeseries.js +++ b/api/tiles/soc-stock-recent-timeseries.js @@ -20,7 +20,7 @@ const RAMP = ` const sendImage = (res, z, data) => { res.set('Content-Type', 'image/png'); - if (z < 5) { + if (+z <= 5) { res.set('Cache-Control', 'public,max-age=604800'); } return res.send(Buffer.from(data));