From e5e6f1d0c8903d34602357f0a90681f1fed87087 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sat, 24 Feb 2018 16:43:08 -0500 Subject: [PATCH] Adding font and lone external image to the service worker cache --- webpack.prod.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/webpack.prod.js b/webpack.prod.js index 59185b0..6832459 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -16,7 +16,21 @@ module.exports = [ }), new WorkboxPlugin({ clientsClaim: true, - skipWaiting: true + skipWaiting: true, + runtimeCaching: [ + { + urlPattern: new RegExp('https://licensebuttons.net'), + handler: 'staleWhileRevalidate' + }, + { + urlPattern: new RegExp('http://fonts.googleapis.com'), + handler: 'staleWhileRevalidate' + }, + { + urlPattern: new RegExp('http://fonts.gstatic.com'), + handler: 'staleWhileRevalidate' + } + ] }) ] }),