An open API service indexing awesome lists of open source software.

https://github.com/prozi/offline-worker

service worker for PWA - use fresh then cache response
https://github.com/prozi/offline-worker

Last synced: 2 months ago
JSON representation

service worker for PWA - use fresh then cache response

Awesome Lists containing this project

README

        

# offline-worker

## installation

```bash
$ npm i offline-worker --save-dev
$ cp node_modules/offline-worker/worker.js public
```

where public is your public/static directory

then in your front-end code use:

```js
import register from 'offline-worker';

register();
```

## result

- your service worker makes your page run offline

- first getting fresh requests, and falling back on cache