ember-cli-deploy-appshell v0.2.2
ember-cli-deploy-appshell
This is an ember-cli-deploy plugin that loads your Ember application
via an applicationCache-based shell. It
- reliably caches all your assets for speed and offline use
- always boots your freshest version when the network is sufficiently fast
- never blocks application boot to preemptively cache assets
- works correctly with CDN-deployed assets
- can cache external assets
Demo
This app has a working deploy setup for running out of s3, complete with "lightning deploy"-style activation.
https://github.com/ef4/ember-appcache-demo
Running version is here:
http://appcache-demo.eaf4.com/
Key requirements:
Set
autoRun: falsein the arguments tonew EmberAppin yourember-cli-build.jsfile. Our bootloader code takes over deciding when to boot your app.Remove
loader.jsfrom your package.json, and set_ignoreMissingLoader: truein the arguments tonew EmberAppin yourember-cli-build.jsfile. This addon inlines its own copy ofloader.jsin order to manage ambiguity between multiple versions of your app that may be attempting to load in parallel.Wherever you are deploying
index.html, you must also deployappshell.htmlandappcache.manifest.Make sure you're using fingerprinted assets. This is critical to busting through the application cache to get instant updates when online.
What is appshell.html?
It's a nearly-identical copy of your index.html, with one key difference: it lacks a manifest attribute, so it doesn't get stored in applicationCache. We use it to bust through the cache when we want to check for the latest index. If we find a new index, we shove it into DOM and let it take over immediately, while the normal applicationCache update is happening in the background.