我在我的角度应用程序中添加了pwa模块,但我不想缓存后端请求。我有以下 ngsw-config.json文件:
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"dataGroups":
[
{
"name": "api",
"urls": ["https://mydomain/api/**"],
"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/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
我添加了dataGroups来忽略对所有/ api端点的调用,但是仍然缓存了这些请求。您能帮我弄清楚我对ngsw-config.json配置错误吗?