Skip to content

Instantly share code, notes, and snippets.

@webmaxru
Created October 2, 2017 14:13
Show Gist options
  • Save webmaxru/1613bd4d97710f92d439945c1eb920a0 to your computer and use it in GitHub Desktop.
Save webmaxru/1613bd4d97710f92d439945c1eb920a0 to your computer and use it in GitHub Desktop.
ngsw - configuration file
{
"index": "/index.html",
"appData": {
"test": true
},
"assetGroups": [{
"name": "appshell",
"resources": {
"files": [
"/assets/**/*",
"!/ngsw-worker.js"
],
"versionedFiles": [
"/**/*.html",
"/**/*.js",
"/**/*.css"
],
"urls": [
"https://fonts.googleapis.com/css?family=Material+Icons",
"https://fonts.gstatic.com/s/materialicons/v29/2fcrYFNaTjcS6g4U3t-Y5UEw0lE80llgEseQY3FEmqw.woff2"
]
}
}],
"dataGroups": [{
"name": "api-freshness",
"urls": [
"/timeline"
],
"cacheConfig": {
"maxSize": 100,
"maxAge": "3d",
"timeout": "1m",
"strategy": "freshness"
}
},
{
"name": "api-performance",
"urls": [
"/favorites"
],
"cacheConfig": {
"maxSize": 100,
"maxAge": "3d",
"timeout": "1m",
"strategy": "performance"
}
}]
}
@m98
Copy link

m98 commented Dec 13, 2017

How to do "add to homescreen" using Angular service-worker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment