Last active
January 27, 2024 11:19
-
-
Save onderceylan/c46451a67458713673cd26cffe793363 to your computer and use it in GitHub Desktop.
Build a production ready PWA with Angular and Firebase - ngsw-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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