0

I have only found two options that accept this plugin that are cacheFirst and networkFirst but I can not find the option for Cache then network to get updates.

    { 
      urlPattern: /^https:\/\/mlm-s2-p\.mlstatic\.com/,
      handler: 'cacheFirst',
    options: {
        cache: {
            maxEntries: 1000,
            name: 'mercadolibre-images-cache-s2c'
          }
      }
    },
OscarDev
  • 917
  • 14
  • 34
  • Have you checked the official documentation for [Caching Files with Service Worker](https://developers.google.com/web/ilt/pwa/caching-files-with-service-worker#top_of_page)? – MαπμQμαπkγVπ.0 Feb 14 '19 at 10:44
  • @MαπμQμαπkγVπ.0 Of course, but the plugin I am working with does not have to write the entire code of the caching form. Did you read and check the plugin I'm using? https://github.com/GoogleChromeLabs/sw-precache – OscarDev Feb 14 '19 at 22:08

1 Answers1

0

handler: 'fastest' will give you the behavior that you want. That corresponds to the fastest handler in sw-toolbox: https://googlechromelabs.github.io/sw-toolbox/api.html#toolboxfastest

Jeff Posnick
  • 53,580
  • 14
  • 141
  • 167