Конфигурация ngsw. json
{
"$schema": "./node_modules/@angular/service-
worker/config/schema.json",
"index": "/test/test/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/test/test/favicon.ico",
"/test/test/index.html",
"/test/test/manifest.webmanifest",
"/test/test/*.css",
"/test/test/*.js"
],
"urls": [
"https://test.com/test/test/upload/**",
"https://fonts.googleapis.com/css?
family=Roboto:300,400,500&display=swap",
"https://fonts.googleapis.com/icon?family=Material+Icons"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/test/test/assets/**",
"/test/test/*.
(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
],
"dataGroups": [
{
"name": "test-api",
"urls": [
"https://test.com/test/api/**"
],
"cacheConfig": {
"maxSize": 20,
"maxAge": "30d",
"timeout": "5s",
"strategy": "freshness"
}
}
]
}