How to use the workbox-strategies/NetworkFirst.js.NetworkFirst function in workbox-strategies

To help you get started, we’ve selected a few workbox-strategies examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChrome / workbox / packages / workbox-google-analytics / src / initialize.ts View on Github external
const createGtmJsRoute = (cacheName: string) => {
  const match = ({url}: RouteMatchCallbackOptions) =>
      url.hostname === GTM_HOST &&
      url.pathname === GTM_JS_PATH;

  const handler = new NetworkFirst({cacheName});

  return new Route(match, handler, 'GET');
};