Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-service-worker-index

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-service-worker-index

An Ember Service Worker plugin that caches the index.html file

  • 0.7.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

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.

Installation

ember install ember-service-worker-index

Configuration

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

      // Indicate the caching strategy to use for the index.html file.
      // cache-first: read from the cache first
      // fallback: attempt to load but fallback to the cache after the timeout specified in "timeout" option
      // defaults to "cache-first"
      strategy: 'fallback',

      // Used along with strategy of "fallback".
      // The number of milliseconds to wait for newly loaded index file before falling back to the cache
      // defaults to 500 milliseconds
      timeout: 500,

      // 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 http://ember-service-worker.com/documentation/configuration/#versioning
      version: '1'
    }
  });

  return app.toTree();
};

Authors

Versioning

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

@dockyard

Licensed under the MIT license

Keywords

FAQs

Package last updated on 15 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc