From 1b163179591a4f2638cac99d56303b433057a316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Mon, 10 Jun 2019 14:45:17 +0200 Subject: [PATCH] Add new dataGroup for caching static content --- ngsw-config.json | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ngsw-config.json b/ngsw-config.json index be36d5d04..ea3dde80d 100644 --- a/ngsw-config.json +++ b/ngsw-config.json @@ -4,26 +4,36 @@ [ { "name": "api", - "urls": ["/**"], + "urls": ["/api/**"], "cacheConfig": { "strategy": "freshness", "maxSize": 500, "timeout": "3s", "maxAge": "7d" } + }, + { + "name": "source", + "urls": ["!/**/*api*"], + "cacheConfig": { + "strategy": "performance", + "maxSize": 500, + "timeout": "3s", + "maxAge": "30d" + } } ], "assetGroups": [ { "name": "app", - "installMode": "prefetch", - "updateMode": "prefetch", + "installMode": "lazy", + "updateMode": "lazy", "resources": { "files": [ "/favicon.ico", "/*.html", - "/*.css", - "/*.js" + "/*.scss", + "/*.ts" ], "urls": [ "https://fonts.googleapis.com/**" -- GitLab