Everytime I make any change to the index.html
with my Angular project, Service Worker never gets updated and always serves the old cached version on index.html
. How do I fix this (Also, there is no caching at the server end as well as browser)
Here is my ngsw-config
file:
{
"index": "/index.html",
"assetGroups": [{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.json"
],
"versionedFiles": [
"/*.bundle.css",
"/*.bundle.js",
"/*.chunk.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}]
}
My response headers for the request:
Any idea how to get this fixed?
Thanks