a zip code slack clone

service-worker.js 741B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Check out https://googlechromelabs.github.io/sw-toolbox/ for
  3. * more info on how to use sw-toolbox to custom configure your service worker.
  4. */
  5. 'use strict';
  6. importScripts('./build/sw-toolbox.js');
  7. self.toolbox.options.cache = {
  8. name: 'ionic-cache'
  9. };
  10. // pre-cache our key assets
  11. self.toolbox.precache(
  12. [
  13. './build/main.js',
  14. './build/vendor.js',
  15. './build/main.css',
  16. './build/polyfills.js',
  17. 'index.html',
  18. 'manifest.json'
  19. ]
  20. );
  21. // dynamically cache any other local assets
  22. self.toolbox.router.any('/*', self.toolbox.fastest);
  23. // for any other requests go to the network, cache,
  24. // and then only use that cached resource if your user goes offline
  25. self.toolbox.router.default = self.toolbox.networkFirst;