Skip to content

Instantly share code, notes, and snippets.

@SergeyMell
Last active November 16, 2017 09:56
Show Gist options
  • Save SergeyMell/d50a68905dc4a60146c3975d98d3e093 to your computer and use it in GitHub Desktop.
Save SergeyMell/d50a68905dc4a60146c3975d98d3e093 to your computer and use it in GitHub Desktop.
Configuration file for Service Worker in Angular applications
{
"index": "/index.html",
"appData": {
"name": "Angular Service Worker Example",
"description": "Example of Angular v5 application utilizing SW functionality"
},
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html"
],
"versionedFiles": [
"/*.bundle.css",
"/*.bundle.js",
"/*.chunk.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
},
{
"name": "fonts",
"resources": {
"urls": [
"https://fonts.googleapis.com/**"
]
}
}
],
"dataGroups": [
{
"name": "api",
"urls": [
"/api/**"
],
"cacheConfig": {
"strategy": "freshness",
"maxSize": 100,
"maxAge": "3d",
"timeout": "10s"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment