dsw
Version:
Dynamic Service Worker, offline Progressive Web Apps much easier
121 lines (120 loc) • 3.27 kB
JSON
{
"dswVersion": 2.2,
"applyImmediately": true,
"appShell": [],
"enforceSSL": false,
"dswRules": {
"moved-pages": {
"match": { "path": "\/old-site\/(.*)" },
"apply": {
"redirect": "/redirected.html?$1"
}
},
"imageNotFound": {
"match": {
"status": [404, 500],
"extension": ["jpg", "gif", "png", "jpeg", "webp"]
},
"apply": {
"fetch": "/images/public/404.jpg"
}
},
"redirectOlderPage": {
"match": {
"path": "\/legacy-images\/.*"
},
"apply": {
"fetch": "/images/public/gizmo.jpg"
}
},
"pageNotFound": {
"match": {
"status": [404]
},
"apply": {
"fetch": "/404.html"
}
},
"imageNotCached": {
"match": { "path": "\/images\/not-cached" },
"apply": {
"cache": false
}
},
"images": {
"match": { "extension": ["jpg", "gif", "png", "jpeg", "webp"] },
"apply": {
"cache": {
"name": "cachedImages",
"version": "1"
}
}
},
"statics": {
"match": { "extension": ["js", "css"] },
"apply": {
"cache": {
"name": "static-files",
"version": "1"
}
}
},
"static-html": {
"match": { "extension": ["html"] },
"apply": {
"cache": {
"name": "static-html-files",
"version": "1"
}
}
},
"userData": {
"match": { "path": "\/api\/user\/.*" },
"options": { "credentials": "same-origin"},
"apply": {
"indexedDB": {
"name": "userData",
"version": "1",
"indexes": ["name"]
}
}
},
"updates": {
"match": { "path": "\/api\/updates/" },
"keepItWarm": true,
"apply": {
"indexedDB": {
"name": "shownUpdates",
"version": "1"
}
}
},
"articles": {
"match": { "path": "\/api\/updates/" },
"apply": {
"cache": {
"name": "cachedArticles",
"version": "1"
}
}
},
"events": {
"match": { "path": "\/api\/events/" },
"apply": {
"indexedDB": {
"name": "eventsList",
"version": "1"
}
}
},
"lineup": {
"match": { "path": "\/api\/events\/(.*)/" },
"apply": {
"indexedDB": {
"name": "eventLineup-$1",
"version": "1"
}
}
}
}
}