From b820a41e7480d75920cdd3e0d1fd62640c1b4962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdo=CC=81n=20Rodri=CC=81guez=20Davila?= Date: Fri, 29 Sep 2017 10:07:00 +0200 Subject: [PATCH 1/3] Cache the polyfills in runtimeCaching --- sw-precache-config.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sw-precache-config.js b/sw-precache-config.js index 478589686..932008a1b 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -12,9 +12,21 @@ module.exports = { staticFileGlobs: [ + 'bower_components/webcomponentsjs/webcomponents-loader.js', + 'images/*', 'index.html', 'manifest.json', - 'bower_components/webcomponentsjs/*', + ], + runtimeCaching: [ + { + urlPattern: /bower_components\/webcomponentsjs\/.*.js/, + handler: 'fastest', + options: { + cache: { + name: 'webcomponentsjs-polyfills-cache', + }, + }, + }, ], navigateFallback: 'index.html', }; From e0b48dba6841806435b8f8452f45abdef0ace30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abd=C3=B3n=20Rodr=C3=ADguez=20Davila?= Date: Fri, 29 Sep 2017 20:04:52 +0200 Subject: [PATCH 2/3] Remove index.html --- sw-precache-config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/sw-precache-config.js b/sw-precache-config.js index 932008a1b..3211ff0a3 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -14,7 +14,6 @@ module.exports = { staticFileGlobs: [ 'bower_components/webcomponentsjs/webcomponents-loader.js', 'images/*', - 'index.html', 'manifest.json', ], runtimeCaching: [ @@ -28,5 +27,4 @@ module.exports = { }, }, ], - navigateFallback: 'index.html', }; From 1a78872087cf65de420e0f20d905eb211ed13956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abd=C3=B3n=20Rodr=C3=ADguez=20Davila?= Date: Mon, 2 Oct 2017 19:46:44 +0200 Subject: [PATCH 3/3] Keep the leading slash --- sw-precache-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw-precache-config.js b/sw-precache-config.js index 3211ff0a3..1f94a51c9 100644 --- a/sw-precache-config.js +++ b/sw-precache-config.js @@ -18,7 +18,7 @@ module.exports = { ], runtimeCaching: [ { - urlPattern: /bower_components\/webcomponentsjs\/.*.js/, + urlPattern: /\/bower_components\/webcomponentsjs\/.*.js/, handler: 'fastest', options: { cache: {