In a local environment my Ng7 app works perfectly when serviced by http-server
. However, when deployed online with Netlify no files are cached using the following ngsw-config.json
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
I have found that is caches some of the js
files but they all have a 0 content length, meaning they actually don't even have any content. Interestingly, it refuses to cache the main.HASH.js file which is actually the largest.
UPDATE
I have taken my lead from this question and removed index.html
from the files I can get the .js
file list to show in the cache store.