Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build a production ready PWA with Angular and Firebase - ngsw-config.json
{
"index": "/index.html",
"appData": {
"version": "1.1.0",
"changelog": "Added better resource caching"
},
"assetGroups": [
{
"name": "shell",
"installMode": "prefetch",
"updateMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/vendor.*.js",
"/main.*.js",
"/polyfills.*.js",
"/runtime.*.js",
"/*.js",
"!/*-sw.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/svg/**"
],
"urls": [
"https://fonts.googleapis.com/**"
]
}
}
],
"dataGroups": [
{
"name": "from-static",
"version": 1,
"urls": ["/data/data.json"],
"cacheConfig": {
"strategy": "performance",
"maxSize": 10,
"maxAge": "1d",
"timeout": "5s"
}
},
{
"name": "from-api",
"version": 2,
"urls": ["/dashboard", "/user"],
"cacheConfig": {
"strategy": "freshness",
"maxSize": 15,
"maxAge": "1h",
"timeout": "3s"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment