text: /**
   * @file service-worker.js with workbox api
   * @desc [example](https://workbox-samples.glitch.me/examples/workbox-sw/)
   * @author kamyochae(1465678596@qq.com)
   */
  
  /* globals workbox */
  workbox.core.setCacheNameDetails({
      prefix: 'lavas-cache',
      suffix: 'v1',
      precache: 'install-time',
      runtime: 'run-time',
      googleAnalytics: 'ga'
  });
  workbox.skipWaiting();
  workbox.clientsClaim();
  
  workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
  
  /**
   * example runningCache with api
   */
  // workbox.routing.registerRoute(/^https:\/\/lavas\.baidu\.com\/some\/api/,
  //     workbox.strategies.networkFirst());
  
  
  /**
   * example runningCache with resources from CDN
   * including maxAge, maxEntries
   * cacheableResponse is important for CDN
   */
  // workbox.routing.registerRoute(/^https:\/\/cdn\.baidu\.com/i,
  //     workbox.strategies.cacheFirst({
  //         cacheName: 'lavas-cache-images',
  //         plugins: [
  //             new workbox.expiration.Plugin({
  //                 maxEntries: 100,
  //                 maxAgeSeconds: 7 * 24 * 60 * 60
  //             }),
  //             new workbox.cacheableResponse.Plugin({
  //                 statuses: [0, 200]
  //             })
  //         ]
  //     })
  // );
  
  // http://localhost:12306/api/getArtCom?art_id=21
  workbox.routing.registerRoute(/^http:\/\/localhost\:12306\/api/,
      workbox.strategies.networkFirst());
  