From 6a2f380f143b7bfafca057e680b1144b637aaaef Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Fri, 4 Feb 2022 10:07:52 +0100 Subject: [PATCH] fix: ghost caching in pwa was making ui unavailable --- ngsw-config.json | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ngsw-config.json b/ngsw-config.json index f8bf2102e..e5b82fb2a 100644 --- a/ngsw-config.json +++ b/ngsw-config.json @@ -6,13 +6,7 @@ "name": "app", "installMode": "prefetch", "resources": { - "files": [ - "/favicon.ico", - "/index.html", - "/manifest.webmanifest", - "/*.css", - "/*.js" - ] + "files": ["/favicon.ico", "/index.html", "/manifest.webmanifest", "/*.css", "/*.js"] } }, { @@ -20,10 +14,19 @@ "installMode": "lazy", "updateMode": "prefetch", "resources": { - "files": [ - "/assets/**", - "/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)" - ] + "files": ["/assets/**", "/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"] + } + } + ], + "dataGroups": [ + { + "name": "ghost", + "urls": ["/blog/**"], + "cacheConfig": { + "strategy": "freshness", + "maxSize": 10000, + "maxAge": "12h", + "timeout": "5s" } } ] -- GitLab