Giter Club home page Giter Club logo

jakecache's Introduction

JakeCache

Declarative manifest-driven app cache built on top of ServiceWorker.

Build status js-standard-style

Why?

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

๐Ÿ˜‚

Polyfill

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!

Installation

npm install jakecache --save

Get started

  1. Create a new JakeCache Manifest, app.manifest and save it in your root together with the jakecache.js file:
CACHE MANIFEST
# 2010-06-18:v2

# Explicitly cached 'master entries'.
CACHE:
/test.html

# Resources that require the user to be online.
NETWORK:
*
  1. Include jakecache.js on your page, maybe via <script src="jakecache.js"></script>
  2. Add <html manifest="app.manifest"> to your HTML.
  3. That's it! Your website is now Jake-enabled!

License

See LICENSE.md

About this project

This is a project by Kenneth Christiansen & Kenneth Auchenberg and a result of too much ๐Ÿบ and โ˜•.

jakecache's People

Contributors

adenilson avatar amilajack avatar auchenberg avatar ejb avatar eqsoft avatar kenchris avatar kyleamathews avatar nielsleenheer avatar olivertitze avatar rdela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jakecache's Issues

Make the swapCache actually work

As the SW can be killed before this call, we might need to store the responses like in an indexedDB, if these can be stored at all. Then remove existing entries and adding the new ones.

What isn't working?

Can you add a section to README which describes what isn't working/isn't compatible with AppCache?

how was this graph made

features.json shows the following in the demo-environment:

screenshot 2019-01-02 at 03 17 26

which is basically:

screenshot 2019-01-02 at 03 16 34

question: how was this made? Using the ui or programmatically?

Check for serviceworker support

Safari 10 doesn't support serviceworkers, so line 111 causes the following error:

TypeError: undefined is not an object (evaluating 'navigator.serviceWorker.addEventListener')

Since Safari still supports appcache, can jakecache let that take over as a fallback?

Compile ES6 build

Since Chrome 54 (the latest version at the time of writing) doesn't support some fancy features like import, I suggest bundling a dist version of jakecache transpiled into ES5.

(Ps. I fully intend to tackle these issues myself. Just noting them for future reference.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.