预取数据组Angular Service-Worker

时间:2019-05-22 13:23:16

标签: angular service-worker progressive-web-apps

我只是想知道是否可以通过Angular服务工作者在运行应用程序时在数据组中预取请求?

我试图做类似下面的代码,但是它不起作用。

"dataGroups": [
    {
      "name": "common-lookups",
      "installMode": "prefetch",
      "urls": [
        "/api/common/1.0.0/lookups?*"
      ],
      "cacheConfig": {
        "maxSize": 100,
        "maxAge": "7d",
        "timeout": "5s",
        "strategy": "freshness"
      }
    }
  ]

0 个答案:

没有答案