Declarative manifest-driven app cache built on top of ServiceWorker.
Building offline-first applications has been the ubiquius dream since the early days of the web. Google started by introducing Google Gears, and later followed the web community by building Application Cache.
Application Cache was a great step forward, but had several fundamental flaws that were made famous by Jake Archibald's epic Application Cache is a Douchebag article and talk. So Jake, Alex Russell and many others, have been busy working on the next generation of application caching API's which today are know as the Service Worker Specification.
Service Worker is great, but if you ever had a look at it's API(s) you realize that they are complicated imperative JavaScript API's. These API's tend to scare many web developers who prefer a nice forgiving declarative approach.
So in order to fix the too complicated Service Worker API, we are super excited to introduce JakeCache. A declarative manifest-driven application cache for web applications implemented on top of ServiceWorker.
Sarcasm may occur in this project
😂
JakeCache serves the additional purpose of being as compatible with the HTML5 Application Cache (aka AppCache) as we could make it and may serve as a polyfill in browsers removing such support.
Patches are welcome!
npm install jakecache --save
- Create a new JakeCache Manifest,
app.manifest
and save it in your root together with thejakecache.js
file:
CACHE MANIFEST
# 2010-06-18:v2
# Explicitly cached 'master entries'.
CACHE:
/test.html
# Resources that require the user to be online.
NETWORK:
*
- Include
jakecache.js
on your page, maybe via<script src="jakecache.js"></script>
- Add
<html manifest="app.manifest">
to your HTML. - That's it! Your website is now Jake-enabled!
See LICENSE.md
This is a project by Kenneth Christiansen & Kenneth Auchenberg and a result of too much 🍺 and ☕.