我有一个角度应用(6.0.2)。我设法使其与服务人员一起工作。使用某些URL的新鲜度策略和其他URL的性能策略对应用程序进行缓存和数据。在本地它就像一个魅力。但是,当我在产品上部署我的应用程序时,assetGroups可以工作,而dataGroups不能再工作。这是我的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/**"]
}
}
],
"dataGroups": [
{
"name": "api-freshness",
"urls": [
"https://webapi.azurewebsites.net/api/nextgame",
"https://webapi.azurewebsites.net/api/previousgame",
"https://webapi.azurewebsites.net/api/ns/stats/getShape",
"https://webapi.azurewebsites.net/api/ranking",
"https://webapi.azurewebsites.net/api/games"
],
"cacheConfig": {
"strategy": "freshness",
"maxSize": 100,
"maxAge": "3d",
"timeout": "10s"
}
},
{
"name": "api-performance",
"urls": [
"https://webapi.azurewebsites.net/api/articles",
"https://webapi.azurewebsites.net/api/ns/teamplayer/getplayers/**"
],
"cacheConfig": {
"strategy": "performance",
"maxSize": 100,
"maxAge": "3d"
}
}
]
}
你知道这是怎么回事吗?