Skip to content

service worker for PWA - use fresh then cache response

License

Notifications You must be signed in to change notification settings

Prozi/offline-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

offline-worker

installation

$ 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:

import register from "offline-worker"

register()

result

  • your service worker makes your page run offline

  • first getting fresh requests, and falling back on cache

About

service worker for PWA - use fresh then cache response

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published