有谁知道角度服务工作者是否没有缓存发布请求?我使用@angular 5.2.5 将它集成到我的应用程序中,它缓存了一些请求,但其中一些是帖子,而那些他不缓存的请求,即使它们与我指定的 urls 模式匹配。这是我的 ngsw-config.json
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html"
],
"versionedFiles": [
"/*.bundle.css",
"/*.bundle.js",
"/*.chunk.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
],
"urls": [
"**/fonts.googleapis.com/**/*",
"**/www.gstatic.com/**/*"
]
}
}
],
"dataGroups": [
{
"name": "api-performance",
"urls": [
"/api/attachments/*"
],
"cacheConfig": {
"maxSize": 200,
"maxAge": "7d",
"timeout": "10s",
"strategy": "performance"
}
},
{
"name": "api-freshness",
"urls": [
"/api/*",
"/api/**/*",
"/api/**/**/*",
"/api/**/**/**/*",
"/api/views/*",
"/api/app-structure",
"/api/workflow/view",
"/api/issues/*",
"/.well-known",
"/certs"
],
"cacheConfig": {
"maxSize": 200,
"maxAge": "2d",
"timeout": "10s",
"strategy": "freshness"
}
}
]
}
这只是为了测试而添加的,因为 /views 没有被缓存,而且那是一个发布请求,我尝试添加通配符以匹配模式,但没有成功"/api/*", "/api/**/*", "/api/**/**/*", "/api/**/**/**/*"
。
我在使用 chrome 进行生产构建时测试我的网站时遇到问题,因为对于我们的内部生产环境,我们使用的是自签名证书,有人知道解决方法吗?我尝试了这个响应 ,但 chrome 仍然显示错误并且服务人员没有运行