Javascript ng服务工作者不缓存数据
ng service worker仅在缓存控制响应标头中指定的时间内缓存数据:public,max age=60,s-maxage=60。脱机模式下60秒后,响应504网关超时(来自ServiceWorker)到达请求Javascript ng服务工作者不缓存数据,javascript,angular,typescript,service-worker,progressive-web-apps,Javascript,Angular,Typescript,Service Worker,Progressive Web Apps,ng service worker仅在缓存控制响应标头中指定的时间内缓存数据:public,max age=60,s-maxage=60。脱机模式下60秒后,响应504网关超时(来自ServiceWorker)到达请求 { "$schema": "./node_modules/@angular/service-worker/config/schema.json", "index": "/index.html", "assetGroups": [
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/app/app.component.ts",
"/*.(pdf|odt|eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
],
"dataGroups": [
{
"name": "github-api",
"urls": ["**//api.github.com/**"],
"cacheConfig": {
"strategy": "performance",
"maxSize": "100",
"maxAge": "7d"
}
}
]
}
可能有什么问题?您是如何配置服务人员的?运行哪个命令将service worker安装到angular应用程序?使用以下命令:ng add@angular/pwa--项目名称