fix: do not cache license files in service worker (#1575)

This commit is contained in:
Nolan Lawson 2019-10-15 06:52:27 -07:00 committed by GitHub
parent afb06d988e
commit ac4d512363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,7 @@ const JSON_TEMPLATE = {
dest: 'client/$1' dest: 'client/$1'
}, },
{ {
src: '^/client/.*\\.(js|css|map)$', src: '^/client/.*\\.(js|css|map|LICENSE)$',
headers: { headers: {
'cache-control': 'public,max-age=31536000,immutable' 'cache-control': 'public,max-age=31536000,immutable'
} }

View File

@ -26,6 +26,7 @@ const assets = __assets__
const webpackAssets = __shell__ const webpackAssets = __shell__
.filter(filename => !filename.endsWith('.map')) // don't bother with sourcemaps .filter(filename => !filename.endsWith('.map')) // don't bother with sourcemaps
.filter(filename => !filename.includes('tesseract-core.wasm')) // cache on-demand .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 // `routes` is an array of `{ pattern: RegExp }` objects that
// match the pages in your src // match the pages in your src