在生产环境中,有时我的服务工作者会出错。要解决此问题,是否可以禁用service worker进行剩余api调用?我只想为我的静态页面使用Service Worker。我在登录页面/应用程序页面(登录后)上进行了所有其他api调用:
我不想使用来自api.example.com/**的api调用
这是我得到的错误:
这是我的ngsw-config.json
{
"index": "/index.html",
"dataGroups": [
{
"name": "connect",
"urls": ["/connect"],
"cacheConfig": {
"maxSize": 0,
"maxAge": "0u",
"strategy": "freshness"
}
},
{
"name": "api",
"urls": ["/rest/**"],
"cacheConfig": {
"maxSize": 0,
"maxAge": "0u",
"strategy": "freshness"
}
}
],
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": ["/favicon.ico", "/index.html", "/*.css", "/*.js"]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": ["/assets/**"]
}
}
]
}