From c50656e5fe6dfa3920b030c9d8c66dd7c34005d1 Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Thu, 2 Dec 2021 11:36:01 +1300 Subject: [PATCH] Stop caching for the stylejson. --- packages/lambda-tiler/src/__test__/xyz.test.ts | 2 +- packages/lambda-tiler/src/routes/tile.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lambda-tiler/src/__test__/xyz.test.ts b/packages/lambda-tiler/src/__test__/xyz.test.ts index 73de1fe47..290985305 100644 --- a/packages/lambda-tiler/src/__test__/xyz.test.ts +++ b/packages/lambda-tiler/src/__test__/xyz.test.ts @@ -305,7 +305,7 @@ o.spec('LambdaXyz', () => { const res = await handleRequest(request); o(res.status).equals(200); o(res.header('content-type')).equals('application/json'); - o(res.header('cache-control')).equals('max-age=120'); + o(res.header('cache-control')).equals('no-store'); const body = Buffer.from(res.body ?? '', 'base64').toString(); fakeStyle.sources.basemaps_vector = { diff --git a/packages/lambda-tiler/src/routes/tile.ts b/packages/lambda-tiler/src/routes/tile.ts index 9741598c4..0f72dad98 100644 --- a/packages/lambda-tiler/src/routes/tile.ts +++ b/packages/lambda-tiler/src/routes/tile.ts @@ -173,7 +173,7 @@ export const TileRoute = { const response = new LambdaHttpResponse(200, 'ok'); response.header(HttpHeader.ETag, cacheKey); - response.header(HttpHeader.CacheControl, 'max-age=120'); + response.header(HttpHeader.CacheControl, 'no-store'); response.buffer(data, 'application/json'); req.set('bytes', data.byteLength); return response;