An Ember Service Worker plugin that caches an Ember app's index file
Turn on the "Update on reload" setting in the Application > Service Workers
menu in the Chrome devtools.
ember install ember-service-worker-index
The configuration is done in the ember-cli-build.js
file:
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
'esw-index': {
// Where the location of your index file is at, defaults to `index.html`
location: 'app-shell.html',
// Bypass esw-index and don't serve cached index file for matching URLs
excludeScope: [/\/non-ember-app(\/.*)?$/, /\/another-app(\/.*)?$/],
// changing this version number will bust the cache
version: '1'
}
});
return app.toTree();
};
This library follows Semantic Versioning
Please do! We are always looking to improve this library. Please see our Contribution Guidelines on how to properly submit issues and pull requests.
DockYard, Inc. © 2016