From ac4d5123632dcd3c24ed0fa01061a3f624e9ccc5 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Tue, 15 Oct 2019 06:52:27 -0700 Subject: [PATCH] fix: do not cache license files in service worker (#1575) --- bin/build-now-json.js | 2 +- src/service-worker.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/build-now-json.js b/bin/build-now-json.js index 367ea822..d50a5879 100644 --- a/bin/build-now-json.js +++ b/bin/build-now-json.js @@ -41,7 +41,7 @@ const JSON_TEMPLATE = { dest: 'client/$1' }, { - src: '^/client/.*\\.(js|css|map)$', + src: '^/client/.*\\.(js|css|map|LICENSE)$', headers: { 'cache-control': 'public,max-age=31536000,immutable' } diff --git a/src/service-worker.js b/src/service-worker.js index 537165e6..b6f8078d 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -26,6 +26,7 @@ const assets = __assets__ const webpackAssets = __shell__ .filter(filename => !filename.endsWith('.map')) // don't bother with sourcemaps .filter(filename => !filename.includes('tesseract-core.wasm')) // cache on-demand + .filter(filename => !filename.endsWith('.LICENSE')) // don't bother with license files // `routes` is an array of `{ pattern: RegExp }` objects that // match the pages in your src