Skip to content

Instantly share code, notes, and snippets.

@onderceylan
Last active January 27, 2024 11:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save onderceylan/c46451a67458713673cd26cffe793363 to your computer and use it in GitHub Desktop.
Save onderceylan/c46451a67458713673cd26cffe793363 to your computer and use it in GitHub Desktop.
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