text: /**
   * @file service-worker.js with workbox api
   * @desc [example](https://workbox-samples.glitch.me/examples/workbox-sw/)
   * @author *__ author __*{% if: *__ email __* %}(*__ email __*){% /if %}
   */
  
  /* globals WorkboxSW */
  
  const workboxSW = new WorkboxSW({
      cacheId: 'lavas-cache',
      ignoreUrlParametersMatching: [/^utm_/],
      skipWaiting: true,
      clientsClaim: true
  });
  
  // Define precache injection point.
  workboxSW.precache([]);
  
  /**
   * example runningCache with api
   */
  workboxSW.router.registerNavigationRoute('/appshell');
  workboxSW.router.registerNavigationRoute('/index.html');
  // workboxSW.router.registerRoute(new RegExp('https://query\.yahooapis\.com/v1/public/yql'),
  workboxSW.router.registerRoute(new RegExp('http://127.0.0.1:3000/api/'),
      workboxSW.strategies.networkFirst());
  // workboxSW.router.registerRoute(/^https:\/\/lavas\.baidu\.com\/some\/api/,
  //     workboxSW.strategies.networkFirst());
  
  
  /**
   * example runningCache with resources from CDN
   * including maxAge, maxEntries
   * cacheableResponse is important for CDN
   */
  // workboxSW.router.registerRoute(/^https:\/\/cdn\.baidu\.com/i,
  //     workboxSW.strategies.cacheFirst({
  //         cacheName: 'lavas-cache-images',
  //         cacheExpiration: {
  //             maxEntries: 100,
  //             maxAgeSeconds: 7 * 24 * 60 * 60
  //         },
  //         cacheableResponse: {
  //             statuses: [0, 200]
  //         }
  //     })
  // );
  