1
0
mirror of https://github.com/malumantovanelli/econocart.git synced 2024-06-25 20:30:17 +00:00
econocart/src/service-worker.js
Yago Souza Santos 1db5df3b35 Commit 001
Started ionic project, include the models to project.
2017-04-03 17:33:18 -03:00

30 lines
736 B
JavaScript

/**
* Check out https://googlechrome.github.io/sw-toolbox/docs/master/index.html for
* more info on how to use sw-toolbox to custom configure your service worker.
*/
'use strict';
importScripts('./build/sw-toolbox.js');
self.toolbox.options.cache = {
name: 'ionic-cache'
};
// pre-cache our key assets
self.toolbox.precache(
[
'./build/main.js',
'./build/main.css',
'./build/polyfills.js',
'index.html',
'manifest.json'
]
);
// dynamically cache any other local assets
self.toolbox.router.any('/*', self.toolbox.cacheFirst);
// for any other requests go to the network, cache,
// and then only use that cached resource if your user goes offline
self.toolbox.router.default = self.toolbox.networkFirst;