sw-cache

0.1.2 • Public • Published

Cache Application using a Service Worker

This is a command line tool which launches a proxy to your application and injects a Service Worker into it. This Service Worker will cache every requests by default.

Usage:

sw-cache --target http://localhost:3000 --proxy https://localhost:3001 --injectClient

From the client

var swCacheClient = ( 'sw-cache' );
swCacheClient.load();

// do not cache local requests
swCacheClient.blacklist( 'https://localhost:3001' );

// cache requests manually
swCacheClient.cacheRequest( reqUrl, res );

// retrieve a cached request manually
swCacheClient.getCachedResponse( reqUrl ); // returns a Promise

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    2
  • 0.1.1
    1

Package Sidebar

Install

npm i sw-cache

Weekly Downloads

3

Version

0.1.2

License

none

Last publish

Collaborators

  • tug