An Ember Service Worker plugin that caches the index.html file
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Ember Service Worker Index

ember-service-worker-index is built and maintained by DockYard, contact us for expert Ember.js consulting.

An Ember Service Worker plugin that caches an Ember app's index file

F#$& my assets aren't updating in development mode

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(\/.*)?$/],

      // Leave blank serve index file for all URLs, otherwise ONLY URLs which match
      // this pattern will be served the cached index file so you will need to list
      // every route in your app.
      includeScope: [/\/dashboard(\/.*)?$/, /\/admin(\/.*)?$/],

      // Changing this version number will bust the cache, but you probably do not
      // want to be doing this manually, but rather using `versionStrategy` as
      // explained here
      version: '1'

  return app.toTree();



This library follows Semantic Versioning

Want to help?

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


Licensed under the MIT license