Service Worker tools
Dependency free Service Worker helper library to simplify the usage of some of its most common features. Includes tools such as: cache management, prefetching, offline responses, deferring, ...
Developed and maintained by Veiss Comunicación.
Index
Installation
-
Install the library via NPM.
npm install @veiss-com/sw-tools --save-dev
-
Copy sw.min.js from lib folder to the web root.
-
Include swTools.min.js from lib folder in your website.
-
Add the library configuration to your JavaScript.
var swTools = new swTools('/sw.min.js');
Features
Cache management
Cache types
The library divides cache elements in 3 different caches:
- static: css, js, json, video, ...
- content: HTML pages.
- image
Excluding elements
Form pages and…