【发布时间】:2018-11-04 14:43:52
【问题描述】:
有谁知道角度服务工作者是否没有缓存帖子 要求 ?我使用@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 测试我的网站时遇到问题 因为对于我们正在使用的内部生产环境 自签名证书有人知道解决方法吗?一世 试过this response 但是 chrome 仍然显示错误并且 service worker 没有运行
【问题讨论】:
标签: angular google-chrome service-worker angular-service-worker