如何配置缓存,然后与SW Precache联网?

时间:2019-02-13 20:07:10

标签: javascript service-worker progressive-web-apps sw-precache

我只找到了两个接受此插件的选项,分别是cacheFirst和networkFirst,但找不到Cache然后使用network获取更新的选项。

    { 
      urlPattern: /^https:\/\/mlm-s2-p\.mlstatic\.com/,
      handler: 'cacheFirst',
    options: {
        cache: {
            maxEntries: 1000,
            name: 'mercadolibre-images-cache-s2c'
          }
      }
    },

1 个答案:

答案 0 :(得分:0)

.package(url: "git@github.com:3sidedcube-MY-SSH-HOST/ferno.git", .branch("jwt3")) ], targets: [ .target(name: "App", dependencies: ["FluentSQLite", "Vapor", "Ferno"]), // … 将为您提供所需的行为。这对应于handler: 'fastest'中的fastest处理程序:https://googlechromelabs.github.io/sw-toolbox/api.html#toolboxfastest